@@ -47,7 +47,7 @@ NB: if you don't have a bash shell interpreter on your host computer, look at th
47
47
48
48
### Installation
49
49
50
- ./bin/stack.sh build
50
+ ./bin/dbstack build
51
51
52
52
* NB* : this will take a _ long_time. Also, a fast, unmetered internet connection will help.
53
53
@@ -59,25 +59,25 @@ docker/.env
59
59
60
60
Example: executing the sql statement ` select current_date ` in parallel on all databases:
61
61
62
- ./bin/stack.sh start
63
- ./bin/stack.sh dbconsole sql:execute --sql='select current_date'
64
- ./bin/stack.sh stop
62
+ ./bin/dbstack start
63
+ ./bin/dbconsole sql:execute --sql='select current_date'
64
+ ./bin/dbstack stop
65
65
66
66
A slightly longer sql snippet:
67
67
68
- ./bin/stack.sh dbconsole sql:execute --sql="create table persons(name varchar(255), age int); insert into persons values('significant other', 99); select name as person, age - 60 as conventional_age from persons;"
68
+ ./bin/dbconsole sql:execute --sql="create table persons(name varchar(255), age int); insert into persons values('significant other', 99); select name as person, age - 60 as conventional_age from persons;"
69
69
70
70
If you have a bigger set of SQL statements to execute than it is practical to put in a command-line, you can save them
71
71
to a file and then execute it in parallel on all databases:
72
72
73
- ./bin/stack.sh dbconsole sql:execute --file=./shared/my_huge_script.sql
73
+ ./bin/dbconsole sql:execute --file=./shared/my_huge_script.sql
74
74
75
75
* NB* : to share files between the host computer and the container, put them in the ` shared ` folder.
76
76
77
77
* NB* : you can also execute different sql commands for each database type by saving them to separate files. The ` sql:execute `
78
78
command does replace some tokens in the values of the ` --file ` option. Eg:
79
79
80
- ./bin/stack.sh dbconsole sql:execute --file='./shared/test_{dbtype}.sql'
80
+ ./bin/dbconsole sql:execute --file='./shared/test_{dbtype}.sql'
81
81
82
82
will look for files ` test_mariadb.sql ` , ` test_mssql.sql ` , ` test_mysql.sql ` , ` test_postgresql.sql ` , ` test_sqlite.sql `
83
83
@@ -91,16 +91,20 @@ against the same data set, you have to follow a multiple-step process:
91
91
92
92
You can also list all available database instances and databases:
93
93
94
- ./bin/stack.sh dbconsole instance:list
94
+ ./bin/dbconsole instance:list
95
95
96
- ./bin/stack.sh dbconsole database:list
96
+ ./bin/dbconsole database:list
97
97
98
- As well as test connecting to them using the standard clients:
98
+ As well as connect to them using the standard command-line clients with a shortcut command :
99
99
100
- ./bin/stack.sh run mysql -h mysql_5_5 -u 3v4l -p -e 'select current_date'
101
- ./bin/stack.sh run psql -h postgresql_9_4 -U postgres -c 'select current_date'
102
- ./bin/stack.sh run sqlcmd -S mssqlserver_2019_ga -U sa -Q "select GETDATE() as 'current_date'"
103
- ./bin/stack.sh run sqlite3 /home/db3v4l/data/sqlite/3.27/3v4l.sqlite 'select current_date'
100
+ ./bin/dbconsole database:shell --instance=mysql_5_5
101
+
102
+ If you want to connect to the databases using all the cli options available to the standard clients, you can do it too:
103
+
104
+ ./bin/dbstack run mysql -h mysql_5_5 -u 3v4l -p -e 'select current_date'
105
+ ./bin/dbstack run psql -h postgresql_9_4 -U postgres -c 'select current_date'
106
+ ./bin/dbstack run sqlcmd -S mssqlserver_2019_ga -U sa -Q "select GETDATE() as 'current_date'"
107
+ ./bin/dbstack run sqlite3 /home/db3v4l/data/sqlite/3.27/3v4l.sqlite 'select current_date'
104
108
105
109
The default password for those commands is '3v4l' for all databases except ms sql server, for which it is 3v4l3V4L.
106
110
@@ -110,29 +114,29 @@ your browser is executing).
110
114
111
115
Last but not least, you have access to other command-line tools which can be useful in troubleshooting SQL queries:
112
116
113
- ./bin/stack.sh run ./app/vendor/bin/highlight-query 'and now'
114
- ./bin/stack.sh run ./app/vendor/bin/lint-query 'for something'
115
- ./bin/stack.sh run ./app/vendor/bin/tokenize-query 'completely different'
117
+ ./bin/dbstack run ./app/vendor/bin/highlight-query 'and now'
118
+ ./bin/dbstack run ./app/vendor/bin/lint-query 'for something'
119
+ ./bin/dbstack run ./app/vendor/bin/tokenize-query 'completely different'
116
120
117
121
Or you can just log in to the container where all the command-line tools are, and execute any command you like from there
118
122
119
- ./bin/stack.sh shell
123
+ ./bin/dbstack shell
120
124
php bin/console --help
121
125
122
126
123
127
## Details
124
128
125
129
### Troubleshooting
126
130
127
- After starting the containers via ` ./bin/stack.sh build ` , you can:
131
+ After starting the containers via ` ./bin/dbstack build ` , you can:
128
132
129
- - check if they are all running: ` ./bin/stack.sh ps `
130
- - check if they all bootstrapped correctly: ` ./bin/stack.sh logs `
131
- - check if a specific container bootstrapped correctly, eg: ` ./bin/stack.sh logs worker `
133
+ - check if they are all running: ` ./bin/dbstack ps `
134
+ - check if they all bootstrapped correctly: ` ./bin/dbstack logs `
135
+ - check if a specific container bootstrapped correctly, eg: ` ./bin/dbstack logs worker `
132
136
- check the processes running in one container, eg: ` docker exec -ti db3v4l_postgresql_9_4 ps aux `
133
137
134
- * NB* : if the ` stack.sh ` command fails, you can use ` docker ` and ` docker-compose ` commands for troubleshooting.
135
- See the section 'Alternative commands to stack.sh ' below for examples.
138
+ * NB* : if the ` dbstack ` command fails, you can use ` docker ` and ` docker-compose ` commands for troubleshooting.
139
+ See the section 'Alternative commands to dbstack ' below for examples.
136
140
137
141
### Maintenance
138
142
@@ -176,18 +180,18 @@ More details about advanced use cases are given in the section below.
176
180
See the separate [ FAQ] ( ./doc/FAQ.md ) document.
177
181
178
182
179
- ## Alternative commands to stack.sh
183
+ ## Alternative commands to dbstack and dbconsole
180
184
181
- The ` stack.sh ` command requires a working bash shell interpreter as well as a few, common unix command-line tools.
182
- In case those are not available on your platform (eg. if you are running DB-3v4l on Windows), or if ` stack.sh ` fails
185
+ The ` dbstack ` and ` dbconsole ` commands require a working bash shell interpreter as well as a few, common unix command-line tools.
186
+ In case those are not available on your platform (eg. if you are running DB-3v4l on Windows), or if ` dbstack ` fails
183
187
you can run alternative commands, as detailed here:
184
188
185
- ./bin/stack.sh build => cd docker && touch containers.env.local && docker-compose build
186
- ./bin/stack.sh start => cd docker && docker-compose up -d
187
- ./bin/stack.sh shell => docker exec -ti db3v4l_worker su - db3v4l
188
- ./bin/stack.sh stop => cd docker && docker-compose stop
189
+ ./bin/dbstack build => cd docker && touch containers.env.local && docker-compose build
190
+ ./bin/dbstack start => cd docker && docker-compose up -d
191
+ ./bin/dbstack shell => docker exec -ti db3v4l_worker su - db3v4l
192
+ ./bin/dbstack stop => cd docker && docker-compose stop
189
193
190
- ./bin/stack.sh dbconsole ... =>
194
+ ./bin/dbconsole ... =>
191
195
docker exec -ti db3v4l_worker su - db3v4l
192
196
php bin/dbconsole ...
193
197
0 commit comments