- Notifications
You must be signed in to change notification settings - Fork4
License
Apache-2.0, MIT licenses found
Licenses found
Apache-2.0
LICENSE-APACHEMIT
LICENSE-MITNotificationsYou must be signed in to change notification settings
rust-postgres/rust-postgres-large-object
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A crate providing access to the Postgres large object API.
externcrate postgres;externcrate postgres_large_object;use std::fs::File;use std::io;use postgres::{Connection,TlsMode};use postgres_large_object::{LargeObjectExt,LargeObjectTransactionExt,Mode};fnmain(){let conn =Connection::connect("postgres://postgres@localhost",TlsMode::None).unwrap();letmut file =File::open("vacation_photos.tar.gz").unwrap();let trans = conn.transaction().unwrap();let oid = trans.create_large_object().unwrap();{letmut large_object = trans.open_large_object(oid,Mode::Write).unwrap(); io::copy(&mut file,&mut large_object).unwrap();} trans.commit().unwrap();letmut file =File::create("vacation_photos_copy.tar.gz").unwrap();let trans = conn.transaction().unwrap();letmut large_object = trans.open_large_object(oid,Mode::Read).unwrap(); io::copy(&mut large_object,&mut file).unwrap();}
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE orhttp://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT orhttp://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submittedfor inclusion in the work by you shall be dual licensed as above, without anyadditional terms or conditions.
About
No description, website, or topics provided.
Resources
License
Apache-2.0, MIT licenses found
Licenses found
Apache-2.0
LICENSE-APACHEMIT
LICENSE-MITUh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.