feat: add drizzle

This commit is contained in:
Max Koon
2025-10-14 19:06:52 -04:00
parent 032f38b711
commit e27a48edb5
20 changed files with 920 additions and 77 deletions

View File

@@ -0,0 +1,165 @@
/* eslint-disable */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// This file was automatically generated by drizzle-zero.
// You should NOT make any changes in this file as it will be overwritten.
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import type { Row } from "@rocicorp/zero";
import { createBuilder } from "@rocicorp/zero";
import type { DrizzleToZeroSchema, ZeroCustomType } from "drizzle-zero";
import type * as drizzleSchema from "./db/schema/public";
type ZeroSchema = DrizzleToZeroSchema<typeof drizzleSchema>;
/**
* The Zero schema object.
* This type is auto-generated from your Drizzle schema definition.
*/
export const schema = {
tables: {
transaction: {
name: "transaction",
columns: {
id: {
type: "string",
optional: false,
customType: null as unknown as ZeroCustomType<
ZeroSchema,
"transaction",
"id"
>,
},
user_id: {
type: "string",
optional: false,
customType: null as unknown as ZeroCustomType<
ZeroSchema,
"transaction",
"user_id"
>,
},
name: {
type: "string",
optional: false,
customType: null as unknown as ZeroCustomType<
ZeroSchema,
"transaction",
"name"
>,
},
amount: {
type: "number",
optional: false,
customType: null as unknown as ZeroCustomType<
ZeroSchema,
"transaction",
"amount"
>,
},
},
primaryKey: ["id"],
},
users: {
name: "users",
columns: {
id: {
type: "string",
optional: false,
customType: null as unknown as ZeroCustomType<
ZeroSchema,
"users",
"id"
>,
},
name: {
type: "string",
optional: true,
customType: null as unknown as ZeroCustomType<
ZeroSchema,
"users",
"name"
>,
},
email: {
type: "string",
optional: false,
customType: null as unknown as ZeroCustomType<
ZeroSchema,
"users",
"email"
>,
},
emailVerified: {
type: "boolean",
optional: true,
customType: null as unknown as ZeroCustomType<
ZeroSchema,
"users",
"emailVerified"
>,
serverName: "email_verified",
},
image: {
type: "string",
optional: true,
customType: null as unknown as ZeroCustomType<
ZeroSchema,
"users",
"image"
>,
},
createdAt: {
type: "number",
optional: true,
customType: null as unknown as ZeroCustomType<
ZeroSchema,
"users",
"createdAt"
>,
serverName: "created_at",
},
updatedAt: {
type: "number",
optional: true,
customType: null as unknown as ZeroCustomType<
ZeroSchema,
"users",
"updatedAt"
>,
serverName: "updated_at",
},
},
primaryKey: ["id"],
serverName: "user",
},
},
relationships: {},
enableLegacyQueries: true,
enableLegacyMutators: true,
} as const;
/**
* Represents the Zero schema type.
* This type is auto-generated from your Drizzle schema definition.
*/
export type Schema = typeof schema;
/**
* Represents a row from the "transaction" table.
* This type is auto-generated from your Drizzle schema definition.
*/
export type Transaction = Row<Schema["tables"]["transaction"]>;
/**
* Represents a row from the "users" table.
* This type is auto-generated from your Drizzle schema definition.
*/
export type User = Row<Schema["tables"]["users"]>;
/**
* Represents the Zero schema query builder.
* This type is auto-generated from your Drizzle schema definition.
*/
export const builder = createBuilder(schema);