|
1 | | -import { QueryTable, NumberColumn, StringColumn, DateColumn, BooleanColumn } from "type-sql"; |
2 | | - |
3 | 1 | export interface User { |
4 | 2 | id: number; |
5 | 3 | name: string; |
6 | 4 | nickname: string; |
7 | 5 | primaryEmail?: number; |
8 | 6 | password: string; |
9 | 7 | twoFactorEnabled?: boolean; |
10 | | - twoFactorSecret?: boolean; |
11 | | - country?: string; |
| 8 | + twoFactorSecret?: string; |
| 9 | + countryCode?: string; |
12 | 10 | timezone?: string; |
13 | 11 | notificationEmails?: 1 | 2 | 3 | 4; |
14 | 12 | preferredLanguage?: string; |
15 | 13 | prefersReducedMotion?: boolean; |
16 | 14 | createdAt?: Date; |
17 | 15 | updatedAt?: Date; |
18 | 16 | } |
19 | | - |
20 | | -export class UserTable extends QueryTable<User, number> { |
21 | | - id = new NumberColumn(this, "id"); |
22 | | - name = new StringColumn(this, "name"); |
23 | | - nickname = new StringColumn(this, "nickname"); |
24 | | - primaryEmail = new NumberColumn(this, "primaryEmail"); |
25 | | - password = new StringColumn(this, "password"); |
26 | | - twoFactorEnabled = new BooleanColumn(this, "twoFactorEnabled"); |
27 | | - twoFactorSecret = new StringColumn(this, "twoFactorSecret"); |
28 | | - country = new StringColumn(this, "country"); |
29 | | - timezone = new StringColumn(this, "timezone"); |
30 | | - notificationEmails = new NumberColumn(this, "notificationEmails"); |
31 | | - preferredLanguage = new StringColumn(this, "preferredLanguage"); |
32 | | - prefersReducedMotion = new BooleanColumn(this, "prefersReducedMotion"); |
33 | | - createdAt = new DateColumn(this, "createdAt"); |
34 | | - updatedAt = new DateColumn(this, "updatedAt"); |
35 | | -} |
36 | | - |
37 | | -export const USER = new UserTable("User"); |
0 commit comments