Skip to content

Latest commit

 

History

History
267 lines (159 loc) · 9.25 KB

format.md

File metadata and controls

267 lines (159 loc) · 9.25 KB

dbcp / Exports / format

Module: format

Table of contents

Enumerations

Type aliases

Functions

Type aliases

DatabaseCopyShardFunctionOverride

Ƭ DatabaseCopyShardFunctionOverride: (value: Record<string, any>, modulus: number) => number

Type declaration

▸ (value: Record<string, any>, modulus: number): number

Parameters

Name Type
value Record<string, any>
modulus number

Returns: number

Defined in: format.ts:67


DatabaseCopyTransformFactory

Ƭ DatabaseCopyTransformFactory: () => Duplex

Type declaration

▸ (): Duplex

Returns: Duplex

Defined in: format.ts:77

Functions

formatContentType

formatContentType(format?: DatabaseCopyFormat | null): undefined | "application/x-ndjson" | "application/json" | "application/sql"

Parameters

Name Type
format? DatabaseCopyFormat | null

Returns: undefined | "application/x-ndjson" | "application/json" | "application/sql"

Defined in: format.ts:183


formatHasSchema

formatHasSchema(format?: DatabaseCopyFormat | DatabaseCopyTransformFactory): boolean

Parameters

Name Type
format? DatabaseCopyFormat | DatabaseCopyTransformFactory

Returns: boolean

Defined in: format.ts:241


guessFormatFromFilename

guessFormatFromFilename(filename?: string): null | csv | json | jsonl | parquet | tfrecord | sql

Parameters

Name Type
filename? string

Returns: null | csv | json | jsonl | parquet | tfrecord | sql

Defined in: format.ts:79


guessInputTypeFromFilename

guessInputTypeFromFilename(filename?: string): null | level | sqlite

Parameters

Name Type
filename? string

Returns: null | level | sqlite

Defined in: format.ts:92


guessOutputTypeFromFilename

guessOutputTypeFromFilename(filename?: string): null | level | sqlite

Parameters

Name Type
filename? string

Returns: null | level | sqlite

Defined in: format.ts:100


inputHasDatabaseFile

inputHasDatabaseFile(format?: DatabaseCopyInputType | null): boolean

Parameters

Name Type
format? DatabaseCopyInputType | null

Returns: boolean

Defined in: format.ts:197


inputIsSqlDatabase

inputIsSqlDatabase(format?: DatabaseCopyInputType | null): boolean

Parameters

Name Type
format? DatabaseCopyInputType | null

Returns: boolean

Defined in: format.ts:217


nonCustomFormat

nonCustomFormat(format?: DatabaseCopyFormat | DatabaseCopyTransformFactory | null): DatabaseCopyFormat | undefined

Parameters

Name Type
format? DatabaseCopyFormat | DatabaseCopyTransformFactory | null

Returns: DatabaseCopyFormat | undefined

Defined in: format.ts:251


outputHasDatabaseFile

outputHasDatabaseFile(format?: DatabaseCopyOutputType | null): boolean

Parameters

Name Type
format? DatabaseCopyOutputType | null

Returns: boolean

Defined in: format.ts:207


outputIsSqlDatabase

outputIsSqlDatabase(format?: DatabaseCopyOutputType | null): boolean

Parameters

Name Type
format? DatabaseCopyOutputType | null

Returns: boolean

Defined in: format.ts:229


pipeFromOutputFormatTransform

pipeFromOutputFormatTransform(output: WritableStreamTree, format: DatabaseCopyFormat | DatabaseCopyTransformFactory, db?: Knex, tableName?: string, options?: { columnType?: Record<string, string> ; schema?: Column[] }): WritableStreamTree | Promise<WritableStreamTree>

Parameters

Name Type
output WritableStreamTree
format DatabaseCopyFormat | DatabaseCopyTransformFactory
db? Knex
tableName? string
options? object
options.columnType? Record<string, string>
options.schema? Column[]

Returns: WritableStreamTree | Promise<WritableStreamTree>

Defined in: format.ts:145


pipeInputFormatTransform

pipeInputFormatTransform(input: ReadableStreamTree, format: DatabaseCopyFormat | DatabaseCopyTransformFactory): ReadableStreamTree | Promise<ReadableStreamTree>

Parameters

Name Type
input ReadableStreamTree
format DatabaseCopyFormat | DatabaseCopyTransformFactory

Returns: ReadableStreamTree | Promise<ReadableStreamTree>

Defined in: format.ts:108