import * as func from './func'; import * as util from './util'; import { Kysely } from 'kysely'; import { type Knex } from 'knex'; import Bookshelf from '@metabrainz/bookshelf'; import type { DB } from './types/schema'; /** * Initialize the database connection and models. * @param {Knex.Config} config - A knex.js configuration object. * @returns {Object} All data models. */ export default function init(config: Knex.Config): { AchievementType: typeof Bookshelf.Model; AchievementUnlock: typeof Bookshelf.Model; AdminLog: typeof Bookshelf.Model; Alias: typeof Bookshelf.Model; AliasSet: typeof Bookshelf.Model; Annotation: typeof Bookshelf.Model; Area: typeof Bookshelf.Model; AreaType: typeof Bookshelf.Model; Author: typeof Bookshelf.Model; AuthorCredit: typeof Bookshelf.Model; AuthorCreditName: typeof Bookshelf.Model; AuthorData: typeof Bookshelf.Model; AuthorHeader: typeof Bookshelf.Model; AuthorImport: typeof Bookshelf.Model; AuthorRevision: typeof Bookshelf.Model; AuthorType: typeof Bookshelf.Model; Disambiguation: typeof Bookshelf.Model; Edition: typeof Bookshelf.Model; EditionData: typeof Bookshelf.Model; EditionFormat: typeof Bookshelf.Model; EditionGroup: typeof Bookshelf.Model; EditionGroupData: typeof Bookshelf.Model; EditionGroupHeader: typeof Bookshelf.Model; EditionGroupImport: typeof Bookshelf.Model; EditionGroupRevision: typeof Bookshelf.Model; EditionGroupType: typeof Bookshelf.Model; EditionHeader: typeof Bookshelf.Model; EditionImport: typeof Bookshelf.Model; EditionRevision: typeof Bookshelf.Model; EditionStatus: typeof Bookshelf.Model; Editor: typeof Bookshelf.Model; EditorEntityVisits: typeof Bookshelf.Model; EditorType: typeof Bookshelf.Model; Entity: typeof Bookshelf.Model; ExternalServiceOauth: typeof Bookshelf.Model; Gender: typeof Bookshelf.Model; Identifier: typeof Bookshelf.Model; IdentifierSet: typeof Bookshelf.Model; IdentifierType: typeof Bookshelf.Model; Language: typeof Bookshelf.Model; LanguageSet: typeof Bookshelf.Model; Note: typeof Bookshelf.Model; Publisher: typeof Bookshelf.Model; PublisherData: typeof Bookshelf.Model; PublisherHeader: typeof Bookshelf.Model; PublisherImport: typeof Bookshelf.Model; PublisherRevision: typeof Bookshelf.Model; PublisherSet: typeof Bookshelf.Model; PublisherType: typeof Bookshelf.Model; Relationship: typeof Bookshelf.Model; RelationshipAttribute: typeof Bookshelf.Model; RelationshipAttributeSet: typeof Bookshelf.Model; RelationshipAttributeTextValue: typeof Bookshelf.Model; RelationshipAttributeType: typeof Bookshelf.Model; RelationshipSet: typeof Bookshelf.Model; RelationshipType: typeof Bookshelf.Model; RelationshipTypeAttributeType: typeof Bookshelf.Model; ReleaseEvent: typeof Bookshelf.Model; ReleaseEventSet: typeof Bookshelf.Model; Revision: typeof Bookshelf.Model; Series: typeof Bookshelf.Model; SeriesData: typeof Bookshelf.Model; SeriesHeader: typeof Bookshelf.Model; SeriesImport: typeof Bookshelf.Model; SeriesOrderingType: typeof Bookshelf.Model; SeriesRevision: typeof Bookshelf.Model; TitleType: typeof Bookshelf.Model; TitleUnlock: typeof Bookshelf.Model; UserCollection: typeof Bookshelf.Model; UserCollectionCollaborator: typeof Bookshelf.Model; UserCollectionItem: typeof Bookshelf.Model; Work: typeof Bookshelf.Model; WorkData: typeof Bookshelf.Model; WorkHeader: typeof Bookshelf.Model; WorkImport: typeof Bookshelf.Model; WorkRevision: typeof Bookshelf.Model; WorkType: typeof Bookshelf.Model; bookshelf: Bookshelf; func: typeof func; kysely: Kysely; util: typeof util; }; export type ORM = ReturnType; export { func };