Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript fix #162

Merged
merged 1 commit into from
Jan 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ interface DropIndexOptionsEn {
export type DropIndexOptions = DropIndexOptionsEn & DropOptions

export interface FunctionParamType {
mode: 'IN' | 'OUT' | 'INOUT' | 'VARIADIC'
name: string
mode?: 'IN' | 'OUT' | 'INOUT' | 'VARIADIC'
name?: string
type: string
default: Value
default?: Value
}

export type FunctionParam = string | FunctionParamType
Expand All @@ -191,14 +191,14 @@ export interface FunctionOptions {
}

interface TriggerOptionsEn {
when: 'BEFORE' | 'AFTER' | 'INSTEAD OF'
when?: 'BEFORE' | 'AFTER' | 'INSTEAD OF'
operation: string | string[]
constraint: boolean
function: Name
level: 'STATEMENT' | 'ROW'
condition: string
deferrable: boolean
deferred: boolean
constraint?: boolean
function?: Name
level?: 'STATEMENT' | 'ROW'
condition?: string
deferrable?: boolean
deferred?: boolean
}

export type TriggerOptions = TriggerOptionsEn & FunctionOptions
Expand All @@ -223,7 +223,7 @@ export type DomainOptionsCreate = DomainOptionsCreateEn & DomainOptions
export type DomainOptionsAlter = DomainOptionsAlterEn & DomainOptions

interface SequenceOptions {
type?: string
type?: Type
increment?: number
minvalue?: number | null | false
maxvalue?: number | null | false
Expand Down Expand Up @@ -271,9 +271,9 @@ export interface CreateOperatorClassOptions {
}

export interface OperatorListDefinition {
type?: string
number?: number
name?: Name
type: 'function' | 'operator'
number: number
name: Name
params?: FunctionParam[]
}

Expand Down Expand Up @@ -342,7 +342,7 @@ export interface MigrationBuilder {
renameSchema(old_schema_name: string, new_schema_name: string): void

// Domains
createDomain(domain_name: Name, domain_options: DomainOptionsCreate): void
createDomain(domain_name: Name, type: Type, domain_options: DomainOptionsCreate): void
dropDomain(domain_name: Name, drop_options: DropOptions): void
alterDomain(domain_name: Name, domain_options: DomainOptionsAlter): void
renameDomain(old_domain_name: Name, new_domain_name: Name): void
Expand All @@ -356,7 +356,7 @@ export interface MigrationBuilder {
// Operators
createOperator(operator_name: Name, options: CreateOperatorOptions): void
dropOperator(operator_name: Name, drop_options: DropOperatorOptions): void
createOperatorClass(operator_class_name: Name, type: Name, index_method: Name, operator_list: OperatorListDefinition, options: CreateOperatorClassOptions): void
createOperatorClass(operator_class_name: Name, type: Type, index_method: Name, operator_list: OperatorListDefinition, options: CreateOperatorClassOptions): void
dropOperatorClass(operator_class_name: Name, index_method: Name, drop_options: DropOptions): void
renameOperatorClass(old_operator_class_name: Name, index_method: Name, new_operator_class_name: Name): void
createOperatorFamily(operator_family_name: Name, index_method: Name): void
Expand Down
2 changes: 1 addition & 1 deletion lib/operations/domains.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const create = (type_shorthands) => {

return template`CREATE DOMAIN "${domain_name}" AS ${applyType(type, type_shorthands).type}${constraintsString};`;
};
_create.reverse = drop;
_create.reverse = (domain_name, type, options) => drop(domain_name, options);
return _create;
};

Expand Down