opencode/packages/core/src/credential/sql.ts
2026-06-12 22:50:54 -04:00

15 lines
601 B
TypeScript

import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core"
import { Timestamps } from "../database/schema.sql.js"
import type { IntegrationSchema } from "../integration/schema"
import type { Credential } from "../credential"
export const CredentialTable = sqliteTable("credential", {
id: text().$type<Credential.ID>().primaryKey(),
integration_id: text().$type<IntegrationSchema.ID>(),
label: text().notNull(),
value: text({ mode: "json" }).$type<Credential.Info>().notNull(),
connector_id: text(),
method_id: text(),
active: integer({ mode: "boolean" }),
...Timestamps,
})