-
Notifications
You must be signed in to change notification settings - Fork 29
Mysql test #496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Mysql test #496
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
b9f6cfd
test error remaining
invaliduser 10d83f3
run-test
invaliduser 3969cfc
remove myrm
invaliduser a698fb3
json-extract handling normalized and fixed for mysql and maria both
invaliduser 7e2efc3
prittay
invaliduser 4df513c
prittay
invaliduser 915cca2
little bits
invaliduser 24e979d
moves reaction trigger outside of transaction
invaliduser bf09d0c
docs, truncate fix, mysql infra
invaliduser 3310fdc
expanded matrix
invaliduser 268ff82
Merge remote-tracking branch 'origin/main' into mysql-test
invaliduser 7f3db2b
minor Makefile cleanup
invaliduser e6a9761
updated default test version of mysql and comment
invaliduser 85e50ed
updates docs to correctly show default test version of mysql
invaliduser 2bc1556
update docs
invaliduser 3b97287
removed unnecessary newline
invaliduser 55eda81
removed unnecessary db-type env var in mysql docker-compose
invaliduser 622b5be
splitting the atom
invaliduser 17f890d
spark joy
invaliduser a4ac0e0
docs
invaliduser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,6 @@ | ||
| #!/bin/sh | ||
|
|
||
| MACHINE=`bin/machine.sh` | ||
|
|
||
| runtimes/$MACHINE/bin/java -Dfile.encoding=UTF-8 -server -cp lrsql.jar lrsql.mariadb.main $@ | ||
| #COMMENT: SQL-LRS uses the same code to interface with MySQL as it uses for MariaDB; the above is intentional. |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,41 @@ | ||
| [<- Back to Index](index.md) | ||
|
|
||
| # MySQL | ||
|
|
||
| SQL-LRS supports MySQL. | ||
|
|
||
| To run SQL-LRS with MySQL, you need a properly configured MySQL instance. "Properly configured" really just means setting up a database, user, and password, and configuring SQL-LRS to connect to/with those. | ||
|
|
||
| ## Environment Variables | ||
|
|
||
| You can configure MySQLDB by setting the relevant environment variables. Here is the `environment` entry from our [MySQL docker-compose demo](https://github.com/yetanalytics/lrsql/blob/main/dev-resources/mysql/docker-compose.yml) | ||
|
|
||
| ```yml | ||
| environment: | ||
| MYSQL_ROOT_PASSWORD: lrsql_root_password | ||
| MYSQL_DATABASE: lrsql_db | ||
| MYSQL_USER: lrsql_user | ||
| MYSQL_PASSWORD: lrsql_password | ||
| ``` | ||
|
|
||
| (`MYSQL_ROOT_PASSWORD` can be anything, as SQL-LRS doesn't use the root account. It is only included here because the MySQL Docker container requires a root password setting. See the [MySQL docs](https://dev.mysql.com/doc/refman/8.4/en/docker-mysql-more-topics.html] for details) | ||
|
|
||
| The corresponding `lrsql.json` would look like | ||
|
|
||
| ```json | ||
| { | ||
| ... | ||
| "database": { | ||
| "dbHost": "0.0.0.0", | ||
| "dbPort": 3306, | ||
| "dbName": "lrsql_db", | ||
| "dbUser": "lrsql_user", | ||
| "dbPassword": "lrsql_password", | ||
| } | ||
| } | ||
|
|
||
| ``` | ||
|
|
||
| ## Precision Limitation | ||
|
|
||
| SQL-LRS stores statements in its implementation databases as JSON. Due to the way MySQL interprets numbers in JSON, we **cannot guarantee more than 15 significant digits of precision** when using SQL-LRS alongside MySQL. If you need that much precision, consider using SQL-LRS alongside [Postgres](postgres.md) or [MariaDB](mariadb.md) instead. |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ services: | |
| db: | ||
| image: postgres | ||
| volumes: | ||
| - db_data:/var/lib/postgresql/data | ||
| - db_data:/var/lib/postgresql | ||
| environment: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PG threw an error when I tried to run it as such; apparently versions of PG 18+ want to store their data in |
||
| POSTGRES_USER: lrsql_user | ||
| POSTGRES_PASSWORD: lrsql_password | ||
|
|
||
This file contains hidden or 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,29 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <launch4jConfig> | ||
| <dontWrapJar>true</dontWrapJar> | ||
| <headerType>console</headerType> | ||
| <classPath> | ||
| <mainClass>lrsql.mariadb.main</mainClass> | ||
| <cp>lrsql.jar</cp> | ||
| </classPath> | ||
| <outfile>lrsql_mysql.exe</outfile> | ||
| <errTitle>You must have Java 11+ installed to run SQL LRS</errTitle> | ||
| <chdir>.</chdir> | ||
| <priority>normal</priority> | ||
| <downloadUrl>http://java.com/download</downloadUrl> | ||
| <supportUrl>https://yet.zendesk.com/hc/en-us</supportUrl> | ||
| <stayAlive>false</stayAlive> | ||
| <restartOnCrash>false</restartOnCrash> | ||
| <manifest></manifest> | ||
| <icon>lrsql.ico</icon> | ||
| <jre> | ||
| <path>runtimes/windows</path> | ||
| <bundledJre64Bit>false</bundledJre64Bit> | ||
| <bundledJreAsFallback>false</bundledJreAsFallback> | ||
| <minVersion>11</minVersion> | ||
| <maxVersion></maxVersion> | ||
| <jdkPreference>preferJre</jdkPreference> | ||
| <runtimeBits>64/32</runtimeBits> | ||
| <opt>-Dfile.encoding=UTF-8</opt> | ||
| </jre> | ||
| </launch4jConfig> |
Binary file not shown.
This file contains hidden or 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
This file contains hidden or 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,4 @@ | ||
| #merge | ||
| [#include "prod/default/connection.edn" | ||
| {:pool-minimum-idle #long #or [#env LRSQL_POOL_MINIMUM_IDLE 10] | ||
| :pool-maximum-size #long #or [#env LRSQL_POOL_MAXIMUM_SIZE 10]}] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://hub.docker.com/_/mysql/ for available versions