-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e342d49
commit fcc4fd2
Showing
5 changed files
with
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ logs | |
_build | ||
.idea | ||
rebar3.crashdump | ||
|
||
datadir |
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,2 @@ | ||
echo "CREATE DATABASE ${USER};" | psql -h 127.0.0.1 -p 10432 template1 | ||
psql -h 127.0.0.1 -p 10432 template1 < test/data/test_schema.sql |
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,8 @@ | ||
#!/bin/sh | ||
|
||
if [ -z $(which initdb) ] ; then | ||
echo "Postgres not found, you may need to add /usr/lib/postgresql/<version>/bin to PATH." | ||
exit 1 | ||
fi | ||
|
||
initdb --locale en_US.UTF-8 datadir |
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,10 @@ | ||
#!/bin/sh | ||
|
||
if [ -z $(which postgres) ] ; then | ||
echo "Postgres not found, you may need to add /usr/lib/postgresql/<version>/bin to PATH." | ||
exit 1 | ||
fi | ||
|
||
postgres -D datadir/ -p 10432 -k `pwd`/datadir/ & | ||
# Sleep for a bit and wait for the DB to start | ||
sleep 1 |
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,17 @@ | ||
-- | ||
-- Adapted from epgsql tests | ||
-- | ||
create user squeel_test; | ||
|
||
drop database if exists squeel_test_db; | ||
create database squeel_test_db with encoding 'UTF8'; | ||
grant all on database squeel_test_db to squeel_test; | ||
|
||
\c squeel_test_db; | ||
|
||
create table test_table ( | ||
id integer primary key, | ||
value text | ||
); | ||
insert into test_table (id, value) values (1, 'one'); | ||
insert into test_table (id, value) values (2, 'two'); |