Duplicate indexes when using `serial('').primaryKey()`
serial('id').primaryKey()
in one of my tables, the primary key index gets duplicated.
```text
mysql> SHOW INDEXES FROM tokens;
+--------+------------+--------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+...
Multiple .where() calls with $dynamic not working
.where()
calls to a query created with .$dynamic()
only the last .where()
call gets applied to the resulting query.
I put together the following example that adds two .where()
calls but only the last one is applied. You can see the resulting query in the console.
https://codesandbox.io/p/sandbox/charming-herschel-8c9rk6?file=%2Findex.js%3A7%2C11...Can't figure out this simple one-to-many relationship
InferSelectModel on views
InferSelectModel
for views.
Appreciate your help!...get last inserted id with mysql
How to retrieve database credentials from drizzle.config.ts
drizzle.config.ts
, instead of saving them in a .env, by running drizzle-kit push
. The issue, both methods I tried rely on top-level await and throw Top-level await is currently not supported with the "cjs" output format
exception.
1. @aws-sdk/client-ssm
example:
```
const { SSMClient, GetParameterCommand } = require("@aws-sdk/client-ssm");...How to query todos from multiple lists/all lists

how can i delete if row exists (where eq(xxx)), otherwise insert, in one query?
mysql 5.7.4 lateral issues
Extracting the Query "With" Type
const query = db.user.findFirst({ with: This Type})
const query = db.user.findFirst({ with: This Type})
Table foreign key action fields
foreignKey
option inside the table config so that I do not have issues with the identifier being longer than allowed. Is there a way to achieve this whilst also setting the onCascade
and onUpdate
action properties like you could previously with the .references()
syntax?
I tried leaving both of them in place (like in the code below) with the hope that it would only generate one foreign key with my name provided and the actions I set with references()
but it generates two constraints in the SQL migration file, one with my custom identifier and no actions and one with the default generated constraint name (too long for my DB) and with the actions. I didn't really expected this to work but It would be good to know the best approach going forward to set the custom FK name and also set the actions. Perhaps it is something missed with the latest update for the new foreignKey()
functionality?
(I could always just change the migration file manually, like I had previously been doing for the foreign key names which were too long but they kept coming back in future migrations with the default generated name, presumably because the _journal.json
files have references to the generated fk names which I had overwritten?)...Decimal Inferred is a string

error with ILIKE on libsql
Dynamic query building
withPagination
function using query building, but the types are causing an error.
https://orm.drizzle.team/docs/dynamic-query-building...
Another SSL error on import
drizzle-kit introspect:pg
here is my drizzle.config.ts...Confusing error with neon
Generate Random UUID Sqlite
model User {
id String @id @default(uuid())
}
model User {
id String @id @default(uuid())
}
Logging query time
[How To?] Generate uuids properly on cloudflare d1 sqlite...
Dropping primary keys every time
``
ALTER TABLE
account` DROP PRIMARY KEY;...