@@ -37,14 +37,18 @@ In the meantime, you can try out http://sqlfiddle.com/
37
37
38
38
* Docker-compose: version 1.10 or later
39
39
40
+ * Recommended: bash shell
41
+
40
42
* minimum RAM, CPU, Disk space: these have not been measured, but you probably want something better than a raspberry pi...
41
43
42
44
43
45
## Quick Start
44
46
47
+ NB: if you have no bash shell interpreter on your host computer, scroll to the end for alternative instructions
48
+
45
49
### Installation
46
50
47
- cd docker && touch containers.env.local && docker-compose build
51
+ ./bin/stack.sh build
48
52
49
53
* NB* : this will take a _ long_time. Also, a fast, unmetered internet connection will help.
50
54
@@ -59,39 +63,34 @@ the host computer, please change variables COMPOSE_WEB_LISTEN_PORT_HTTP and COMP
59
63
60
64
Example: executing the sql snippet ` select current_date ` in parallel on all databases:
61
65
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
70
69
71
70
If you have a bigger set of SQL commands to execute than it is practical to put in a command-line, you can save them
72
71
to a file and then execute it in parallel on all databases:
73
72
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
75
74
76
75
* NB* to share files between the host computer and the container, put them in the ` shared ` folder.
77
76
78
77
* NB* you can also execute different sql commands based on database type by saving them to separate files. The ` sql:execute `
79
78
command does replace some tokens in the values of the ` --file ` option. Eg:
80
79
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'
82
81
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 `
84
83
85
- From within the worker container, you can also list all available database instances:
84
+ You can also list all available database instances:
86
85
87
- php bin/console db3v4l:instance:list
86
+ ./ bin/stack.sh console db3v4l:instance:list
88
87
89
88
As well as test connecting to them using the standard clients:
90
89
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'
95
94
96
95
The default password for those commands is '3v4l' for all databases except ms sql server, for which it is 3v4l3V4L.
97
96
@@ -101,9 +100,9 @@ your browser is executing).
101
100
102
101
Last but not least, you have access to other command-line tools which can be useful in troubleshooting SQL queries:
103
102
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
107
106
108
107
109
108
## Details
@@ -155,6 +154,18 @@ After starting the containers via `docker-compose up -d`, you can:
155
154
such as passwords
156
155
157
156
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
+
158
169
## Thanks
159
170
160
171
Many thanks to
0 commit comments