| 1 | import { |
| 2 | boolean, |
| 3 | int, |
| 4 | mysqlEnum, |
| 5 | mysqlTable, |
| 6 | text, |
| 7 | timestamp, |
| 8 | varchar, |
| 9 | } from "drizzle-orm/mysql-core"; |
| 10 | |
| 11 | export const databaseEngineTypes = |
| 12 | "mysql", |
| 13 | "mariadb", |
| 14 | "postgresql", |
| 15 | "mongodb", |
| 16 | "redis", |
| 17 | ] as const; |
| 18 | |
| 19 | export type DatabaseEngineType |
| 20 | |
| 21 | export const databaseHosts = |
| 22 | id: varchar("id |
| 23 | name: varchar("name |
| 24 | type: mysqlEnum("type |
| 25 | host: varchar("host |
| 26 | port: int("port |
| 27 | username: varchar("username |
| 28 | password: text("password |
| 29 | ssl: boolean("ssl |
| 30 | maxDatabases: int("max_databases |
| 31 | allowedNodeIds: text("allowed_node_ids |
| 32 | createdAt: timestamp("created_at |
| 33 | updatedAt: timestamp("updated_at |
| 34 | .defaultNow() |
| 35 | .$onUpdate(() => |
| 36 | .notNull(), |
| 37 | }); |