You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
^^this should compile (i.e. it runs fine in plain javascript) but it produces a type error. Same thing happens for CreateTableBuilder
Error message
Property 'datetime' does not exist on type AlterTableBuilder
and
Property 'double' does not exist on type AlterTableBuilder
Reduced test code, for example in https://npm.runkit.com/knex or if it needs real
database connection to MySQL or PostgreSQL, then single file example which initializes
needed data and demonstrates the problem.
There are types missing from SchemaBuilder as well. Having a compile error with knex.schema.createExtensionIfNotExists('uuid-ossp')
Grepping the source it looks like the method is there in lib/schema/builder.js but the type definition isn't present in types/index.d.ts. This is my second day with TypeScript so I don't know how to fix it, but I would if I could.
Happy to open a new issue if it's helpful.
Oh also knexjs.org doesn't have the "ifNotExists" versions of various methods documented. I found them with Google luck.
I would assume that datetime doesn't exist in the definition file because the alias dateTime does (and is probably preferred?). Not sure about double though.
Environment
Knex version: 0.21.1
Database + version: mysql 8.0.20
OS: Fedora 30
@lorefnon
Bug
^^this should compile (i.e. it runs fine in plain javascript) but it produces a type error. Same thing happens for CreateTableBuilder
Property 'datetime' does not exist on type AlterTableBuilder
and
Property 'double' does not exist on type AlterTableBuilder
database connection to MySQL or PostgreSQL, then single file example which initializes
needed data and demonstrates the problem.
See above. You can also see it by inspecting the type.
Worth noting that while it appears
double
is still undocumented,datetime
is in the docs and is not camel-cased in the example like it is in the type.Thanks for taking a look!
The text was updated successfully, but these errors were encountered: