Created
April 25, 2024 19:42
-
-
Save PaulieScanlon/4f3b52738108dd2e4acff11ba6ce150b to your computer and use it in GitHub Desktop.
pg-to-ts generated types
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
// ./pg-to-ts-db.d.ts | |
// Table users | |
export interface Users { | |
id: number; | |
first_name: string; | |
last_name: string; | |
email: string; | |
country: string | null; | |
} | |
export interface UsersInput { | |
id?: number; | |
first_name: string; | |
last_name: string; | |
email: string; | |
country?: string | null; | |
} | |
const users = { | |
tableName: 'users', | |
columns: ['id', 'first_name', 'last_name', 'email', 'country'], | |
requiredForInsert: ['first_name', 'last_name', 'email'], | |
primaryKey: 'id', | |
foreignKeys: {}, | |
$type: null as unknown as Users, | |
$input: null as unknown as UsersInput | |
} as const; | |
export interface TableTypes { | |
users: { | |
select: Users; | |
input: UsersInput; | |
}; | |
} | |
export const tables = { | |
users, | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment