Options
All
  • Public
  • Public/Protected
  • All
Menu

@pdftron/collab-sql-resolver-generator

Index

Variables

SQLClient: { Postgres: "pg"; MSSQL: "mssql"; SQLite3: "sqlite3"; Oracle: "oracledb"; MySQL: "mysql" } = ...

Type declaration

  • Postgres: "pg"
  • MSSQL: "mssql"
  • SQLite3: "sqlite3"
  • Oracle: "oracledb"
  • MySQL: "mysql"
MutationOperationType: { CREATE: "create"; UPDATE: "update" } = ...

Constants representing the types of mutations being made to the database. For use in middleware.

Type declaration

  • CREATE: "create"
  • UPDATE: "update"
SQLResolverGenerator: { LogLevels: typeof LogLevels; LogTags: typeof LogTags } = ...

Type declaration

Type aliases

CollabSQLResolverGeneratorOptions: { client: SQLClientOptions; info: EntityInfo; connection: ConnectionOptions | Knex.StaticConnectionConfig | Knex.ConnectionConfigProvider; getDatabaseTimestamp?: GetDatabaseTimestamp; parseToUnixTimestamp?: any; pool?: { min: number; max: number }; logLevel?: LogLevels; transports?: winston.transport[]; filterLogsByTag?: LogTags | LogTags[]; version?: "string" }

Type declaration

  • client: SQLClientOptions

    The type of database you are using

  • info: EntityInfo

    Information about your database schema. See this guide for more info.

  • connection: ConnectionOptions | Knex.StaticConnectionConfig | Knex.ConnectionConfigProvider

    Information about connecting to your database. Accepts anything that Knex accepts for connection options

  • Optional getDatabaseTimestamp?: GetDatabaseTimestamp

    A function to convert a unix timestamp to the format that your database used. Accepts a number as a parameter and must return a timestamp in your DB format. See this guide for more info

  • parseToUnixTimestamp?:function
    • parseToUnixTimestamp(timestamp: string): number
    • A function to convert your database timestamps into a unix timestamp in MS. Accepts the timestamp from your database and must return an integer. See this guide for more info

      Parameters

      • timestamp: string

      Returns number

  • Optional pool?: { min: number; max: number }

    Information about database connection pooling. Accepts anything that Knex accepts

    • min: number
    • max: number
  • Optional logLevel?: LogLevels

    Log level. See this guide for more info.

  • Optional transports?: winston.transport[]

    Log transports. See this guide for more info.

  • Optional filterLogsByTag?: LogTags | LogTags[]

    Filter logs by tag. See this guide for more info.

  • Optional version?: "string"

    The version of database you are using. This typically is not required

SQLClientOptions: "mysql" | "pg" | "sqlite3" | "oracledb" | "mssql"
ConnectionOptions: { host?: string; user?: string; password?: string; database?: string; filename?: string; socketPath?: string }

Type declaration

  • Optional host?: string
  • Optional user?: string
  • Optional password?: string
  • Optional database?: string
  • Optional filename?: string
  • Optional socketPath?: string
GetDatabaseTimestamp: (timestamp: number) => string | number

Type declaration

    • (timestamp: number): string | number
    • Parameters

      • timestamp: number

      Returns string | number

Middleware<T>: MiddlewareFunction<T>[]

Type parameters

MiddlewareFunction<T>: (info: MiddlewareParams<T>) => AsyncOrSync<void>

Type parameters

  • T

Type declaration

    • (info: MiddlewareParams<T>): AsyncOrSync<void>
    • Parameters

      • info: MiddlewareParams<T>

      Returns AsyncOrSync<void>

GeneratorEntity<T>: { table: string; columns: OptionsColumns<T>; writeMiddleware?: Middleware<UserDatabaseEntity>; readMiddleware?: Middleware<T>; afterWrite?: any }

Type parameters

  • T: Partial<Entity>

Type declaration

OptionsColumns<T>: { [ Property in keyof T]: GeneratorColumnsOptions }

Type parameters

  • T: Partial<Entity>

UserDatabaseEntity: Record<string, any>
MutationOperations: "create" | "update" | "delete" | "read"

Generated using TypeDoc