Skip to content
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

Draft: [SingleStore] Add SingleStore connector #2727

Draft
wants to merge 102 commits into
base: main
Choose a base branch
from

Conversation

mitchwadair
Copy link

@mitchwadair mitchwadair commented Aug 1, 2024

This PR intends to add SingleStore support to Drizzle ORM. SingleStore is a distributed SQL database that unifies both transactional and analytical workloads. It is largely compatible with MySQL, but there are some incompatibilities and additional features that are supported.

Things done:

  • Add singlestore-core
    • Based on MySQL
    • Disallow foreign keys
    • Add MINUS (a synonym of EXCEPT) (doc)
    • Disallow INTERSECT ALL and EXCEPT ALL
    • Disallow triggers
    • Remove check constraints
    • Add database milestones and branching
      • CREATE MILESTONE (doc)
      • DROP MILESTONE
      • ATTACH DATABASE (doc)
      • DETACH DATABASE (doc)
    • Full-text search capability (doc)
    • Updated relational queries to fix MySQL incompatibilities
  • Add singlestore driver. It is mostly the same as the mysql2 driver as well, as it is 100% compatible due to SingleStore supporting the MySQL protocol over the wire. It just removes the mode because that was specific to MySQL and Planetscale

Notable Changes:

  • Renamed all references from MySQL to SingleStore in the integration tests directory.
  • Modified timestamp precision and other minor test adjustments
  • Updated the test environment to use the SingleStore dev Docker image.

Known Issues:

  • SingleStore does not order by by default, so some test expectations (set operation tests in particular) were modified to expect SingleStore-specific behavior
  • ORDER BY and LIMIT cannot be chained together.
  • INTERSECT ALL, EXCEPT ALL, and nested transaction operations are not supported and associated tests were removed
  • Only one isolationLevel is supported, so associated tests and config options were removed

Things TODO in Future PRs:

  • Add multiple column types that SingleStore supports
    • VECTOR (doc)
    • BSON (doc)
    • Geospatial types (doc)
      • GEOGRAPHYPOINT
      • GEOGRAPHY
    • BLOB types (doc)
    • UUID/GUID (doc)
      • These will be unique type aliases for supporting the UUID() and GUID() generator functions
  • Adapt Drizzle Kit to the above changes
  • Testing
  • Doc
  • Support Pipelines (doc)
  • Support both columnstore and rowstore tables (currently only columnstore)

@mitchwadair mitchwadair marked this pull request as draft August 1, 2024 14:24
@@ -0,0 +1,178 @@
name: Release fork to NPM
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO rm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants