@dbpath/dal
Advanced tools
Comparing version 0.2.9 to 0.2.10
import { Summary } from "@dbpath/config"; | ||
import { DatabaseMetaData } from "./dal"; | ||
import { ErrorsAnd } from "@dbpath/utils"; | ||
import { TwoIds } from "@dbpath/types"; | ||
import { TwoIds, TwoIdsArray } from "@dbpath/types"; | ||
export type ValidateTableNameFn = (tableName: string) => string[]; | ||
@@ -15,3 +15,3 @@ export type ValidateFieldsFn = (tableName: string, fields: string[]) => string[]; | ||
validateLink: ValidateLinkFn; | ||
useIdsOrSingleFkLinkOrError(fromTableName: string, toTableName: string, idEquals: TwoIds[]): TwoIds[]; | ||
useIdsOrSingleFkLinkOrError(fromTableName: string, toTableName: string, idEquals: TwoIds[]): ErrorsAnd<TwoIdsArray>; | ||
actualTableName(tableName: string): string; | ||
@@ -25,4 +25,4 @@ } | ||
/** This should not throw an exception if the validation says there is a link */ | ||
export declare const useIdsOrSingleFkLinkOrError: (summary: Summary, m: DatabaseMetaData) => (fromTableName: string, toTableName: string, idEquals: TwoIds[]) => TwoIds[]; | ||
export declare const useIdsOrSingleFkLinkOrError: (summary: Summary, m: DatabaseMetaData) => (fromTableName: string, toTableName: string, idEquals: TwoIds[]) => ErrorsAnd<TwoIdsArray>; | ||
export declare const validateLinks: (summary: Summary, m: DatabaseMetaData) => ValidateLinkFn; | ||
export declare function DalPathValidator(summary: Summary, m: DatabaseMetaData): PathValidator; |
@@ -10,3 +10,3 @@ "use strict"; | ||
useIdsOrSingleFkLinkOrError(fromTableName, toTableName, idEquals) { | ||
return idEquals; | ||
return { twoIds: idEquals }; | ||
}, | ||
@@ -71,6 +71,6 @@ actualTableName: t => t | ||
if ((0, utils_1.hasErrors)(found)) | ||
throw Error(`Single FK link not found\n${found}`); | ||
return [found]; | ||
return [`Single FK link not found`, ...found]; | ||
return { twoIds: [found] }; | ||
} | ||
return idEquals; | ||
return { twoIds: idEquals }; | ||
}; | ||
@@ -77,0 +77,0 @@ exports.useIdsOrSingleFkLinkOrError = useIdsOrSingleFkLinkOrError; |
{ | ||
"name": "@dbpath/dal", | ||
"description": "", | ||
"version": "0.2.9", | ||
"version": "0.2.10", | ||
"main": "dist/index", | ||
@@ -20,4 +20,4 @@ "types": "dist/index", | ||
"dependencies": { | ||
"@dbpath/config": "0.2.9", | ||
"@dbpath/fixtures": "0.2.9" | ||
"@dbpath/config": "0.2.10", | ||
"@dbpath/fixtures": "0.2.10" | ||
}, | ||
@@ -24,0 +24,0 @@ "devDependencies": { |
17015
+ Added@dbpath/config@0.2.10(transitive)
+ Added@dbpath/fixtures@0.2.10(transitive)
+ Added@dbpath/types@0.2.10(transitive)
+ Added@dbpath/utils@0.2.10(transitive)
- Removed@dbpath/config@0.2.9(transitive)
- Removed@dbpath/fixtures@0.2.9(transitive)
- Removed@dbpath/types@0.2.9(transitive)
- Removed@dbpath/utils@0.2.9(transitive)
Updated@dbpath/config@0.2.10
Updated@dbpath/fixtures@0.2.10