Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

73 Commits

Repository files navigation

rust-postgres-large-object

CircleCI

Documentation

A crate providing access to the Postgres large object API.

Example

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();}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages