File tree Expand file tree Collapse file tree 3 files changed +19
-14
lines changed Expand file tree Collapse file tree 3 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -12,24 +12,25 @@ A library for executing PostgreSQL command line utilities.
1212## Examples
1313
1414``` rust
15+ use postgresql_commands :: Result ;
1516use postgresql_commands :: psql :: PsqlBuilder ;
1617
17- let psql = PsqlBuilder :: new ()
18- . command (" CREATE DATABASE \ " test\ "" )
19- . host (" 127.0.0.1" )
20- . port (5432 )
21- . username (" postgresql" )
22- . pg_password (" password" )
23- . build ();
24-
25- let (stdout , stderr ) = psql . execute (10 ). await ? ;
18+ fn main () -> Result <()> {
19+ let psql = PsqlBuilder :: new ()
20+ . command (" CREATE DATABASE \ " test\ "" )
21+ . host (" 127.0.0.1" )
22+ . port (5432 )
23+ . username (" postgresql" )
24+ . pg_password (" password" )
25+ . build ();
26+
27+ let (stdout , stderr ) = psql . execute ()? ;
28+ Ok (())
29+ }
2630```
2731
2832## Feature flags
2933
30- postgresql_commands uses [ feature flags] to address compile time and binary size
31- uses.
32-
3334The following features are available:
3435
3536| Name | Description | Default? |
Original file line number Diff line number Diff line change @@ -7,7 +7,11 @@ use postgresql_commands::initdb::InitDbBuilder;
77use postgresql_commands:: pg_ctl:: Mode :: { Start , Stop } ;
88use postgresql_commands:: pg_ctl:: PgCtlBuilder ;
99use postgresql_commands:: pg_ctl:: ShutdownMode :: Fast ;
10- use postgresql_commands:: { AsyncCommandExecutor , CommandBuilder , CommandExecutor } ;
10+ #[ cfg( feature = "tokio" ) ]
11+ use postgresql_commands:: AsyncCommandExecutor ;
12+ use postgresql_commands:: CommandBuilder ;
13+ #[ cfg( not( feature = "tokio" ) ) ]
14+ use postgresql_commands:: CommandExecutor ;
1115use std:: fs:: { remove_dir_all, remove_file} ;
1216use std:: io:: prelude:: * ;
1317use std:: net:: TcpListener ;
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ impl Settings {
160160/// Implement the [`Settings`] trait for [`Settings`]
161161impl postgresql_commands:: Settings for Settings {
162162 fn get_binary_dir ( & self ) -> PathBuf {
163- self . get_binary_dir ( ) . clone ( )
163+ self . binary_dir ( ) . clone ( )
164164 }
165165
166166 fn get_host ( & self ) -> OsString {
You can’t perform that action at this time.
0 commit comments