import { ColumnType, Insertable, Selectable, Updateable } from "npm:kysely"; // Shortcuts cuz my monitor is small ;( type Nothing = undefined | null type DateOrStr = Date | string type WrittableOnce = ColumnType type WithDefault = ColumnType export interface TableUsers { id: ColumnType tg_id: number | null joined_by_referal_from_user_id: WrittableOnce is_chat_participant: WithDefault is_captcha_passed: WithDefault is_timeout: WithDefault is_banned: WithDefault created_at: ColumnType joined_chat_at: ColumnType timeout_until: ColumnType } export interface TableInviteLinks { link: WrittableOnce expect_user_tg_id: WrittableOnce valid_until: ColumnType } export interface Database { users: TableUsers invite_links: TableInviteLinks } export type SelectUser = Selectable export type InsertUser = Insertable export type UpdateUser = Updateable export type SelectInviteLinks = Selectable export type InsertInviteLinks = Insertable export type UpdateInviteLinks = Updateable