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

[SingleStore] Add SingleStore connector #3132

Open
wants to merge 51 commits into
base: beta
Choose a base branch
from

Conversation

mitchwadair
Copy link

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.

Key differences between MySQL vs SIngleStore Integration Tests

  • Renamed all references from MySQL to SingleStore in the integration tests directory.
  • The tests are performed against the singlestore-dev docker image, to replicate a production environment
  • SingleStore's serial column type only assures uniqueness of the column values. The tests were modified to (set operation tests in particular) to expect SingleStore-specific behavior, by adding an ORDER BY instruction to every select instruction.
  • ORDER BY and LIMIT cannot be chained together.
  • Removed SingleStore proxy package and its IT tests. If it's necessary, this package can be replicated from the MySQLL proxy package later
  • The foreign key integration tests were removed since they are not supported by singlestore
  • Removed intersectAll and exceptAll tests since these operations are not supported by SIngleStore
  • Removed nested transaction tests since this feature is not supported by SingleStore
  • Removed isolationLevel config and tests as singlestore only supports one isolationLevel

Tests results for SingleStore

Drizzle-kit tests result

image

Drizzle-orm tests result

image

Drizzle-orm type tests result

image

Integration-tests results

image

Side notes

There are some SingleStore-specific operations, such as attach/detach, create/drop milestone and optimizeTable for column stores tables, that are implemented on drizzle-orm/src/singlestore-core but not on drizzle-kit. There are also no integration tests for these operations. This is a known issue and should be fixed in the upcoming releases.

The relational tests that included nested selects with aggregations functions were skipped since SingleStore doesn't support it

@Rodriguespn Rodriguespn force-pushed the feature/new-dialect-singlestore branch 2 times, most recently from 86aa47e to 78db5cf Compare October 16, 2024 00:36
@Rodriguespn Rodriguespn force-pushed the feature/new-dialect-singlestore branch from 78db5cf to b813ee5 Compare October 23, 2024 17:05
@AndriiSherman AndriiSherman self-requested a review November 3, 2024 09:30
@AndriiSherman
Copy link
Member

Starting my review today

@AndriiSherman AndriiSherman changed the base branch from main to beta November 3, 2024 09:30
@AndriiSherman
Copy link
Member

I'll resolve conflicts while doing my review, so no action is needed from your side

@Rodriguespn Rodriguespn force-pushed the feature/new-dialect-singlestore branch from feb0e60 to e9db7f1 Compare November 7, 2024 19:44
@AndriiSherman AndriiSherman changed the base branch from main to beta November 25, 2024 15:34
drizzle-kit/src/cli/validations/singlestore.ts Dismissed Show dismissed Hide dismissed
drizzle-kit/src/introspect-singlestore.ts Dismissed Show dismissed Hide dismissed
drizzle-kit/src/serializer/studio.ts Dismissed Show dismissed Hide dismissed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants