@@ -37,14 +37,18 @@ In the meantime, you can try out http://sqlfiddle.com/
3737
3838* Docker-compose: version 1.10 or later
3939
40+ * Recommended: bash shell
41+
4042* minimum RAM, CPU, Disk space: these have not been measured, but you probably want something better than a raspberry pi...
4143
4244
4345## Quick Start
4446
47+ NB: if you have no bash shell interpreter on your host computer, scroll to the end for alternative instructions
48+
4549### Installation
4650
47- cd docker && touch containers.env.local && docker-compose build
51+ ./bin/stack.sh build
4852
4953* NB* : this will take a _ long_time. Also, a fast, unmetered internet connection will help.
5054
@@ -59,39 +63,34 @@ the host computer, please change variables COMPOSE_WEB_LISTEN_PORT_HTTP and COMP
5963
6064Example: executing the sql snippet ` select current_date ` in parallel on all databases:
6165
62- cd docker && docker-compose up -d
63- docker exec -ti db3v4l_worker su - db3v4l
64- cd app
65-
66- php bin/console db3v4l:sql:execute --sql='select current_date'
67-
68- exit
69- docker-compose stop
66+ ./bin/stack.sh start
67+ ./bin/stack.sh console db3v4l:sql:execute --sql='select current_date'
68+ ./bin/stack.sh stop
7069
7170If you have a bigger set of SQL commands to execute than it is practical to put in a command-line, you can save them
7271to a file and then execute it in parallel on all databases:
7372
74- php bin/console db3v4l:sql:execute --file=./shared/my_huge_script.sql
73+ ./ bin/stack.sh console db3v4l:sql:execute --file=./shared/my_huge_script.sql
7574
7675* NB* to share files between the host computer and the container, put them in the ` shared ` folder.
7776
7877* NB* you can also execute different sql commands based on database type by saving them to separate files. The ` sql:execute `
7978command does replace some tokens in the values of the ` --file ` option. Eg:
8079
81- php bin/console db3v4l:sql:execute --file='./shared/test_{dbtype}.sql'
80+ ./ bin/stack.sh console db3v4l:sql:execute --file='./shared/test_{dbtype}.sql'
8281
83- will look for files ` test_mariadb.sql ` , ` test_mssql.sql ` , ` test_mysql.sql ` , ` test_postgresql.sql ` , ` test_sqlite.sql `
82+ will look for files ` test_mariadb.sql ` , ` test_mssql.sql ` , ` test_mysql.sql ` , ` test_postgresql.sql ` , ` test_sqlite.sql `
8483
85- From within the worker container, you can also list all available database instances:
84+ You can also list all available database instances:
8685
87- php bin/console db3v4l:instance:list
86+ ./ bin/stack.sh console db3v4l:instance:list
8887
8988As well as test connecting to them using the standard clients:
9089
91- mysql -h mysql_5_5 -u 3v4l -p -e 'select current_date'
92- psql -h postgresql_9_4 -U postgres -c 'select current_date'
93- sqlcmd -S mssqlserver_2019_ga -U sa -Q "select GETDATE() as 'current_date'"
94- sqlite3 /home/db3v4l/data/sqlite/3.27/3v4l.sqlite 'select current_date'
90+ ./bin/stack.sh run mysql -h mysql_5_5 -u 3v4l -p -e 'select current_date'
91+ ./bin/stack.sh run psql -h postgresql_9_4 -U postgres -c 'select current_date'
92+ ./bin/stack.sh run sqlcmd -S mssqlserver_2019_ga -U sa -Q "select GETDATE() as 'current_date'"
93+ ./bin/stack.sh run sqlite3 /home/db3v4l/data/sqlite/3.27/3v4l.sqlite 'select current_date'
9594
9695The default password for those commands is '3v4l' for all databases except ms sql server, for which it is 3v4l3V4L.
9796
@@ -101,9 +100,9 @@ your browser is executing).
101100
102101Last but not least, you have access to other command-line tools which can be useful in troubleshooting SQL queries:
103102
104- ./vendor/bin/highlight-query
105- ./vendor/bin/lint-query
106- ./vendor/bin/tokenize-query
103+ ./vendor/bin/highlight-query
104+ ./vendor/bin/lint-query
105+ ./vendor/bin/tokenize-query
107106
108107
109108## Details
@@ -155,6 +154,18 @@ After starting the containers via `docker-compose up -d`, you can:
155154 such as passwords
156155
157156
157+ ## Alternative commands to stack.sh
158+
159+ ./bin/stack.sh build => cd docker && touch containers.env.local && docker-compose build
160+ ./bin/stack.sh start => cd docker && docker-compose up -d
161+ ./bin/stack.sh shell => docker exec -ti db3v4l_worker su - db3v4l
162+ ./bin/stack.sh stop => cd docker && docker-compose stop
163+
164+ ./bin/stack.sh console ... =>
165+ docker exec -ti db3v4l_worker su - db3v4l
166+ php bin/console ...
167+
168+
158169## Thanks
159170
160171Many thanks to
0 commit comments