Skip to content
Permalink
Browse files
Add executable to create the proper databases.
  • Loading branch information
steveklabnik committed Oct 23, 2014
1 parent 333ef67 commit 305bda685ad2c1928dff951add5b271ee74c03ca
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
@@ -8,9 +8,15 @@ In other words: Rust + Ember, sitting in a tree. K I S...

## Getting started

You'll need a postgres instance running on localhost, with a
`rustmvc` user and a `rustmvc` database. When you've got that
going...

```bash
$ git clone https://github.com/steveklabnik/rustmvc
$ cd rustmvc
$ cargo build
$ ./target/create_databases # you only need this the first time
$ cargo run
$ firefox http://localhost:6767/ # in a different shell, of course
```
@@ -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.

Copy link
@haileys

haileys Oct 23, 2014

If only Rust had heredocs

id SERIAL PRIMARY KEY,
title VARCHAR NOT NULL,
is_completed BOOLEAN NOT NULL
)", []).unwrap();
}

0 comments on commit 305bda6

Please sign in to comment.