Drizzle <> SingleStore
To use Drizzle with a SingleStore database, you should use the mysql2
driver
Drizzle ORM natively supports mysql2
with drizzle-orm/singlestore
package.
Step 1 - Install packages
Step 2 - Initialize the driver and make a query
If you need to provide your existing driver:
Client connection
Pool connection
IMPORTANT
For the built in migrate
function with DDL migrations we and drivers strongly encourage you to use single client
connection.
For querying purposes feel free to use either client
or pool
based on your business demands.
Limitations
Currently, the SingleStore dialect has a set of limitations and features that do not work on the SingleStore database side:
- SingleStore’s serial column type only ensures the uniqueness of column values.
ORDER BY
and LIMIT
cannot be chained together.
- Foreign keys are not supported (check).
INTERSECT ALL
and EXCEPT ALL
operations are not supported by SingleStore.
- Nested transactions are not supported by SingleStore.
- SingleStore only supports one
isolationLevel
.
- The FSP option in
DATE
, TIMESTAMP
, and DATETIME
is not supported.
- The relational API is not supported and will be implemented once the SingleStore team develops all the necessary APIs for it.
- There may be more limitations because SingleStore is not 100% compatible with MySQL.
What’s next?