File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
examples/postgres_embedded/src Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -10,20 +10,22 @@ fn main() -> Result<()> {
1010 let database_name = "test" ;
1111 postgresql. create_database ( database_name) ?;
1212 let settings = postgresql. settings ( ) ;
13- let host = settings. host . to_string ( ) ;
14- let port = settings. port . to_string ( ) ;
15- let username = settings. username . to_string ( ) ;
16- let password = settings. password . to_string ( ) ;
17-
1813 let mut client = Client :: connect (
19- format ! ( "host={host} port={port} user={username} password={password}" ) . as_str ( ) ,
14+ format ! (
15+ "host={host} port={port} user={username} password={password}" ,
16+ host = settings. host,
17+ port = settings. port,
18+ username = settings. username,
19+ password = settings. password
20+ )
21+ . as_str ( ) ,
2022 NoTls ,
2123 ) ?;
2224
2325 println ! ( "Creating table 'todos'" ) ;
2426 create_table_todo ( & mut client) ?;
2527
26- let description = "Implement embedded database with sqlx " ;
28+ let description = "Implement embedded database with postgres " ;
2729 println ! ( "Adding new todo with description '{description}'" ) ;
2830 let todo_id = add_todo ( & mut client, description) ?;
2931 println ! ( "Added new todo with id {todo_id}" ) ;
You can’t perform that action at this time.
0 commit comments