Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

2.2 KB
Raw Blame
import type { InferSelectModel } from "drizzle-orm";

import { createSchema } from "@homarr/core/infrastructure/db";

import * as pgSchema from "./postgresql";
import * as sqliteSchema from "./sqlite";

export type PostgreSqlSchema = typeof pgSchema;

export const schema = createSchema({
  "better-sqlite3": () => sqliteSchema,
  "node-postgres": () => pgSchema,
});

// Sadly we can't use export * from here as we have multiple possible exports
export const {
  accounts,
  apiKeys,
  assistantConfigurations,
  assistantMessages,
  assistantThreads,
  apps,
  boardGroupPermissions,
  boardUserPermissions,
  boards,
  groupMembers,
  groupPermissions,
  groups,
  iconRepositories,
  icons,
  integrationGroupPermissions,
  integrationItems,
  integrationSecrets,
  integrationUserPermissions,
  integrations,
  invites,
  items,
  medias,
  onboarding,
  searchEngines,
  sections,
  serverSettings,
  sessions,
  users,
  userItemStates,
  verificationTokens,
  sectionCollapseStates,
  layouts,
  itemLayouts,
  sectionLayouts,
  trustedCertificateHostnames,
  cronJobConfigurations,
  customWidgetDefinitions,
  customWidgetSecrets,
  legacyCustomWidgetDefinitions,
  legacyCustomWidgetSecrets,
  widgetSecrets,
} = schema;

export type User = InferSelectModel<typeof schema.users>;
export type Account = InferSelectModel<typeof schema.accounts>;
export type AssistantConfiguration = InferSelectModel<typeof schema.assistantConfigurations>;
export type AssistantMessage = InferSelectModel<typeof schema.assistantMessages>;
export type AssistantThread = InferSelectModel<typeof schema.assistantThreads>;
export type Session = InferSelectModel<typeof schema.sessions>;
export type VerificationToken = InferSelectModel<typeof schema.verificationTokens>;
export type Integration = InferSelectModel<typeof schema.integrations>;
export type IntegrationSecret = InferSelectModel<typeof schema.integrationSecrets>;
export type CustomWidgetDefinition = InferSelectModel<typeof schema.customWidgetDefinitions>;
export type CustomWidgetSecret = InferSelectModel<typeof schema.customWidgetSecrets>;
export type LegacyCustomWidgetDefinition = InferSelectModel<typeof schema.legacyCustomWidgetDefinitions>;
export type LegacyCustomWidgetSecret = InferSelectModel<typeof schema.legacyCustomWidgetSecrets>;