-
Notifications
You must be signed in to change notification settings - Fork 16
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
[DNM] Implement dialect "tidb+pymysql"/"tidb+mysqldb" for sqlalchemy #63
Conversation
Signed-off-by: JaySon-Huang <[email protected]>
99e76d6
to
9035cdd
Compare
Signed-off-by: JaySon-Huang <[email protected]>
Signed-off-by: JaySon-Huang <[email protected]>
Signed-off-by: JaySon-Huang <[email protected]>
Signed-off-by: JaySon-Huang <[email protected]>
9968ce0
to
1634cf6
Compare
Signed-off-by: JaySon-Huang <[email protected]>
Signed-off-by: JaySon-Huang <[email protected]>
…opper Signed-off-by: JaySon-Huang <[email protected]>
1634cf6
to
c00f202
Compare
Signed-off-by: JaySon-Huang <[email protected]>
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.
Very impressive improvement!! I like the way how user use it now.
Signed-off-by: JaySon-Huang <[email protected]>
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This reverts commit d647211.
Great job! BTW, a simplified and MySQL-compatible syntax for creating vector indexe would be more preferable. |
Yes, we have further plan for making it more easier for creating vector indexes with some optional parameters in the SQL.
Get it. I didn't notice there is such a lib there. I'll try to get the changes merged into sqlalchemy-tidb first. |
As an alternative to #63 After discussion with @JaySon-Huang, inspired by some other vector databases, I think we could simply introduce some side functions for creating indexes. The usage is as simple as using native SQLAlchemy interfaces, without the need to introduce another dialect like sqlalchemy-tidb. Maintaining a new SQLAlchemy dialect is costy, as we need to support both SQLAlchemy 1.4 and SQLAlchemy 2.0, and support other TiDB features like AUTO_RANDOM. --------- Signed-off-by: Wish <[email protected]> Co-authored-by: WD <[email protected]>
Only suite for sqlalchemy~2.0. Closing it because it take too much maintenance cost |
What's changed
TiDBDialect_mysqldb
/TiDBDialect_pymysql
for connection string "tidb+mysqldb"/"tidb+pymysql"ddl_compiler
byTiDBDDLCompiler
so we can generate the correct SQL for:VectorIndex
andTiFlashReplica
so that we can define them using the sqlalchemy frameworkget_declarative_base
so that users can utilize it to define a table model with VectorIndex. See theexamples/orm-sqlalchemy-quickstart/sqlalchemy-quickstart.py
ortests/sqlalchemy/test_sqlalchemy.py
for details.And we can support other tidb-specified features like
AUTO_RANDOM
in the sqlalchemy-tidb frameworkLocal test result
Inspired from