diff options
-rwxr-xr-x | qtest.lua | 9 | ||||
-rwxr-xr-x | test.lua | 9 |
2 files changed, 14 insertions, 4 deletions
@@ -56,7 +56,12 @@ end local utils = require 'lem.utils' local postgres = require 'lem.postgres.queued' -local db = assert(postgres.connect("host=localhost dbname=mydb")) +local db = assert(postgres.connect([[ +host=localhost +user=myuser +password=mypasswd +dbname=mydb +]])) assert(db:exec( 'CREATE TABLE mytable (id integer PRIMARY KEY, name CHARACTER VARYING)')) @@ -106,7 +111,7 @@ do end utils.spawn(function() - utils.sleeper():sleep(1.0) + utils.newsleeper():sleep(1.0) assert(db:exec('DROP TABLE mytable')) end) @@ -56,10 +56,15 @@ end local utils = require 'lem.utils' local postgres = require 'lem.postgres' -local db = assert(postgres.connect("host=localhost dbname=mydb")) +local db = assert(postgres.connect([[ +host=localhost +user=myuser +password=mypasswd +dbname=mydb +]])) assert(db:exec( -'CREATE TABLE mytable (id integer PRIMARY KEY, name CHARACTER VARYING)')) +'CREATE TABLE mytable (id integer PRIMARY KEY, name TEXT)')) assert(db:exec("COPY mytable FROM STDIN (delimiter ',')")) assert(db:put('1,alpha\n')) |