-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
[BUG]: Outdated docs #2191
Comments
Hello @gzuuus! Could you please show your schema? The issue might be caused by something else because docs are updated for composite primary key. I could create composite primary key with this code: import { integer, primaryKey, sqliteTable } from 'drizzle-orm/sqlite-core';
export const tests = sqliteTable(
'tests',
{
authorId: integer('author_id'),
bookId: integer('book_id'),
},
(t) => ({
pk: primaryKey({ columns: [t.bookId, t.authorId] }),
}),
); |
It seems to be fixed by updating the package, at the moment there is no error, however I have found several parts of the documentation to be out of date, as mentioned in the issue |
@gzuuus thank you. Docs were fixed. I think there is no |
I see! In any case, it would be nice to have it documented in the documents so that people know they can use it. |
Agree with you! We will add info about |
What version of
drizzle-orm
are you using?0.28.5
What version of
drizzle-kit
are you using?0.19.13
Describe the Bug
Hey I was trying to work with composite primary keys in sqlite but the documentation is out of date and the syntax seems to be wrong as it says columns is not in type SQLiteColumn.
The object literal can only specify known properties, and 'columns' does not exist in the type 'SQLiteColumn<Required<{ name: string; dataType: ColumnDataType; columnType: string; data: unknown; driverParam: unknown; notNull: boolean; hasDefault: boolean; enumValues: string[] | undefined; tableName: string; }>, object>'.
This is the code I'm testing:
Please fix the docs to represent the current way of doing composite primary keys.
I also noticed that the
numeric
type for sqlite is not listed in the docs, even though it can be used.Expected behavior
No response
Environment & setup
No response
The text was updated successfully, but these errors were encountered: