-
Notifications
You must be signed in to change notification settings - Fork 99
MySQL support #1312
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
Open
sinisaos
wants to merge
76
commits into
piccolo-orm:master
Choose a base branch
from
sinisaos:mysql_engine
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
MySQL support #1312
Changes from all commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
03ff51a
add mysql engine, initial columns types changes, changes to alter method
sinisaos 9418c53
fix create and drop indexes
sinisaos f0bdac4
continue with changes when trying to pass unittest
sinisaos cf1bdb3
fix some serial pk m2m columns and continue trying to pass unittest
sinisaos e5e3c1f
some clean up
sinisaos 2b21878
more changes
sinisaos 80175cd
timestamp, interval and m2m changes
sinisaos 15dedaa
additional changes for unittest passing
sinisaos 7e56178
update_with_joins - same goes for delete_with_joins
sinisaos 0739bb6
enable some refresh tests
sinisaos 40535fa
resolve merge conflicts
sinisaos 2151851
add and change more tests
sinisaos c496a9c
add wrap_in_transaction=False to some migrations test
sinisaos e622c78
some globals for safer MySQL behavior
sinisaos 52d69ba
fix small typos
sinisaos 4fd5859
on_conflict work with MySQL (with MySQL limitation)
sinisaos f77f417
more tests fixed
sinisaos ef3ea83
adds documentation
sinisaos bfb3d94
use aiomysql instead of asyncmy because it is better maintained
sinisaos 5d91cc9
fix docs and some tests
sinisaos b71a4e2
fix integration test for litestar and try to pass action for MySQL
sinisaos b89823b
another try to pass action for MySQL
sinisaos ccc4aec
another try
sinisaos f30b70b
last try
sinisaos 99c4f52
simplified the action using root user and try again
sinisaos 4f58382
try again with actions for mysql
sinisaos 536a654
list hosts
sinisaos a2dc8f3
final try
sinisaos 6e951db
revert github actions
sinisaos bdfc623
add Playground for MySQL
sinisaos 7a23387
adds basic Array functions using JSON
sinisaos 5c297b4
adds JSON arrow and from_path functions for MySQL
sinisaos 0f1237d
small clean up
sinisaos fbd9fa5
adds more tests
sinisaos 765c08c
fix timestamptz and more tests
sinisaos fe97cb8
try to fix mysql workflow
sinisaos fab6407
Merge branch 'piccolo-orm:master' into mysql_engine
sinisaos 22404f0
another try with MySQL actions
sinisaos f75c3dc
another try
sinisaos 8aa1174
MySQL is working now, but needs to be match versions. If 8.4 doesn't …
sinisaos d0a4c8e
add password to connection
sinisaos 6bc32b6
correct env vars names
sinisaos 993c225
port as int not str
sinisaos acae191
localhost -> 127.1.0.0
sinisaos d15c14e
fix typo
sinisaos cb942da
fix linters error by moving imports inside method
sinisaos 2a418a1
uuid and boolean converter
sinisaos fd63947
adds PyMySQL as dependency and try to pass CI
sinisaos 208be6c
adds PyMySQL as main dependency in requirements.txt
sinisaos acdeb62
adds timestamp and timestamptz converter
sinisaos c5e6d0b
fix subtle bug with sql generation for foreign keys
sinisaos 7a0090e
Merge branch 'master' into mysql_engine
sinisaos 3fdc9ab
update connection pool docs
sinisaos aa206c8
start with auto migrations
sinisaos 8de3124
more tests
sinisaos 3a14cdc
handle default values for text,json and blob columns
sinisaos f1dd6bf
remove wrap_in_transaction from auto migrations tests
sinisaos baa1f97
fix defaults and add set_null
sinisaos eefa670
reduce Postgres coverage to 80 due to a lot of MySQL related code
sinisaos fedf946
update docs
sinisaos 0965d14
more tests
sinisaos 4e84b28
Mysql -> MySQL change
sinisaos d400eba
remove duplicate code
sinisaos 61fc755
lazy import pymysql
sinisaos f7ffe84
Merge branch 'piccolo-orm:master' into mysql_engine
sinisaos 6ce311b
add @dantownsend suggestions
sinisaos 4058e49
revert changes in CI
sinisaos a6b9277
change uuid default value
sinisaos 986a679
Merge branch 'master' into mysql_engine
sinisaos 6d64452
fix linters and adjust conflict target
sinisaos c4dffe8
fix linter error
sinisaos 91bfdb2
Merge branch 'master' into mysql_engine
sinisaos 1dc89bd
Merge branch 'master' into mysql_engine
sinisaos 3bb26d3
fix linters and merge conflicts
sinisaos 1e9a627
Merge branch 'master' into mysql_engine
sinisaos 711b468
added mysql property to UUID7 class
sinisaos 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
Some comments aren't visible on the classic Files Changed page.
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 |
|---|---|---|
|
|
@@ -127,4 +127,5 @@ Engine types | |
| ./sqlite_engine | ||
| ./postgres_engine | ||
| ./cockroach_engine | ||
| ./mysql_engine | ||
| ./connection_pool | ||
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,44 @@ | ||
| MySQLEngine | ||
| =========== | ||
|
|
||
| Configuration | ||
| ------------- | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| # piccolo_conf.py | ||
| from piccolo.engine.mysql import MySQLEngine | ||
|
|
||
|
|
||
| DB = MySQLEngine( | ||
| config={ | ||
| "host": "localhost", | ||
| "port": 3306, | ||
| "user": "root", | ||
| "password": "", | ||
| "db": "piccolo", | ||
| } | ||
| ) | ||
|
|
||
| config | ||
| ~~~~~~ | ||
|
|
||
| The config dictionary is passed directly to the underlying database adapter, | ||
| aiomysql. See the `aiomysql docs <https://aiomysql.readthedocs.io/en/stable/connection.html#connection>`_ | ||
| to learn more. | ||
|
|
||
| ------------------------------------------------------------------------------- | ||
|
|
||
| Connection Pool | ||
| --------------- | ||
|
|
||
| See :ref:`ConnectionPool`. | ||
|
|
||
| ------------------------------------------------------------------------------- | ||
|
|
||
| Source | ||
| ------ | ||
|
|
||
| .. currentmodule:: piccolo.engine.mysql | ||
|
|
||
| .. autoclass:: MySQLEngine |
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,28 @@ | ||
| .. _setting_up_mysql: | ||
|
|
||
| ########### | ||
| Setup MySQL | ||
| ########### | ||
|
|
||
| Installation | ||
| ************ | ||
|
|
||
| Follow the `instructions for your OS <https://dev.mysql.com/doc/refman/8.4/en/installing.html>`_. | ||
|
|
||
|
|
||
| Creating a database | ||
| ******************* | ||
|
|
||
| Using ``mysql``: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| mysql -u root -p | ||
|
|
||
| Enter your password and create the database: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| CREATE DATABASE "my_database_name"; | ||
|
|
||
| Alternatively, use a GUI tool. |
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
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.
Uh oh!
There was an error while loading. Please reload this page.