inferring the column information from the imported schema
is there anyway to get the column information from the imported schema information. When I dump the schema I can see that there is [Symbol(drizzle:Columns] property but not sure how I'd access it. Does drizzle provide some sort of API for extracting this data?
5 Replies
What is the use case? What do you want that for? is it for the types or the values?
basically i am using it to build the query from the query string and would like try and automate setting the allowed conditionals and includes, so I don't have to type it out for every query. This would also have the benefit of knowing which type to coerce it too without manually checking.
dialogRoutes.ts
parseConditionals.ts
parseIncludes.ts
getTableColumns
might be what you're looking for: https://orm.drizzle.team/docs/goodies#get-typed-table-columnsGoodies - DrizzleORM
Drizzle ORM | %s
You can also get the table information, it will give you back a lot more: https://orm.drizzle.team/docs/goodies#get-table-information
Goodies - DrizzleORM
Drizzle ORM | %s
perfect, thanks. Didn't spot that.