Last active
May 17, 2024 21:58
-
-
Save PaulieScanlon/84c06357e8f1ad14cfdd3412da2f0b59 to your computer and use it in GitHub Desktop.
Example InferSectionModel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { pgTable, serial, varchar, timestamp, decimal} from 'drizzle-orm/pg-core'; | |
+ import { type InferSelectModel } from 'drizzle-orm'; | |
export const analytics = pgTable('analytics', { | |
id: serial('id').primaryKey(), | |
date: timestamp('date').notNull(), | |
slug: varchar('slug', { length: 255 }).notNull(), | |
referrer: varchar('referrer', { length: 255 }), | |
flag: varchar('flag', { length: 16 }), | |
country: varchar('country', { length: 255 }), | |
city: varchar('city', { length: 255 }), | |
latitude: decimal('latitude'), | |
longitude: decimal('longitude'), | |
}); | |
+ export type AnalyticsType = InferSelectModel<typeof analytics>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment