Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add executable to create the proper databases.
- Loading branch information
1 parent
333ef67
commit 305bda685ad2c1928dff951add5b271ee74c03ca
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| extern crate postgres; | ||
|
|
||
| use postgres::{PostgresConnection, NoSsl}; | ||
|
|
||
| fn main() { | ||
| let conn = PostgresConnection::connect("postgres://rustmvc@localhost", | ||
| &NoSsl).unwrap(); | ||
|
|
||
| conn.execute("CREATE TABLE todos ( | ||
This comment has been minimized.
Sorry, something went wrong. |
||
| id SERIAL PRIMARY KEY, | ||
| title VARCHAR NOT NULL, | ||
| is_completed BOOLEAN NOT NULL | ||
| )", []).unwrap(); | ||
| } | ||
|
|
||
If only Rust had heredocs