IF Commons GitHub

sql/physical/case

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0007-physical FR-001, 0007-physical FR-002

Case styles and naming (commons data 0007-physical FR-001, FR-002): how a list of words is written as a name. snake, camel and pascal are the library's own, snake case is the default, and an extension adds another through the engine's point physical.caseStyle. The stored value of a code is written by a style too, so that employedBy is stored as employed_by in a snake case database and the data already there stays what it was; a project may keep the codes as their names.

Source: commons/data/sql/physical/case.ts

8 of 9 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

camelconst
const camel: CaseStyle

Words joined, each after the first with a capital: givenName, line1.

Imported by 73 tests of the run (73 passed, 0 failed): the library's results

CaseStyleinterface
interface CaseStyle

A case style: a name, and how it writes words.

MemberTypeWhat it is
namestring
write(words: Words) => string

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

caseStylePointconst
const caseStylePoint: ContributionPoint<CaseStyle>

The contribution point an extension fills to add a case style.

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

caseStylesFromfunction
function caseStylesFrom(composition: Composition): readonly CaseStyle[]

The case styles of a composition, in its order.

ParameterWhat it is
compositionthe project's composition

Returns: the styles its extensions contribute

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

namingfunction
function naming(names?: CaseStyle, codes?: "name" | CaseStyle): Naming

A naming.

ParameterWhat it is
namesthe style of the names; snake case where none is given
codesthe style of the stored codes; the style of the names where none is given

Returns: the naming

Imported by 79 tests of the run (79 passed, 0 failed): the library's results

Naminginterfaceno test imports it
interface Naming

How names, and the stored values of codes, are written.

MemberTypeWhat it is
namesCaseStyleThe style of the names of tables, columns, constraints and indexes.
codes"name" | CaseStyleThe style of the stored values of codes, or name to store a code as its name.
pascalconst
const pascal: CaseStyle

Words joined, each with a capital: GivenName, Line1.

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

snakeconst
const snake: CaseStyle

Words joined by an underscore: given_name, line_1.

Imported by 51 tests of the run (51 passed, 0 failed): the library's results

writeCodefunction
function writeCode(n: Naming, code: string): string

The stored value of a code.

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.