sqljson-query
Advanced tools
Comparing version 1.9.5 to 1.9.6
@@ -119,9 +119,13 @@ "use strict"; | ||
case 'clob': | ||
case 'uuid': | ||
return refTableFieldPropertyType(tfp, "String"); | ||
case 'timestamp with time zone': | ||
case 'timestamptz': | ||
return refTableFieldPropertyType(tfp, "Instant"); | ||
case 'timestamp': | ||
return refTableFieldPropertyType(tfp, "LocalDateTime"); | ||
case 'date': | ||
return refTableFieldPropertyType(tfp, "LocalDate"); | ||
case 'time': | ||
case 'timestamp': | ||
case 'timestamp with time zone': | ||
case 'timestamptz': | ||
case 'uuid': | ||
return textTableFieldPropertyType(tfp); | ||
return refTableFieldPropertyType(tfp, "LocalTime"); | ||
case 'bit': | ||
@@ -136,3 +140,3 @@ case 'boolean': | ||
if (lcDbFieldType.startsWith('timestamp')) | ||
return textTableFieldPropertyType(tfp); | ||
return refTableFieldPropertyType(tfp, "String"); | ||
else | ||
@@ -199,2 +203,5 @@ throw new Error(`unsupported type for field '${tfp.databaseFieldName}' of type '${tfp.databaseType}'`); | ||
} | ||
function refTableFieldPropertyType(fp, refType) { | ||
return withNullability(fp.nullable, refType); | ||
} | ||
function booleanTableFieldPropertyType(fp) { | ||
@@ -201,0 +208,0 @@ return withNullability(fp.nullable, "boolean"); |
{ | ||
"name": "sqljson-query", | ||
"version": "1.9.5", | ||
"version": "1.9.6", | ||
"description": "Command line tool to generate SQL/JSON SQL queries and result types for Typescript or Java.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,9 +0,13 @@ | ||
import { upperCamelCase, indentLines, Nullable } from '../../util/mod'; | ||
import { QueryTypesFileHeader, ResultRepr } from '../../query-specs'; | ||
import {indentLines, Nullable, upperCamelCase} from '../../util/mod'; | ||
import {QueryTypesFileHeader, ResultRepr} from '../../query-specs'; | ||
import { | ||
ChildCollectionResultTypeProperty, TableFieldResultTypeProperty, TableExpressionResultTypeProperty, | ||
ParentReferenceResultTypeProperty, NamedResultTypeSpec, requireNamedResultType, | ||
ChildCollectionResultTypeProperty, | ||
NamedResultTypeSpec, | ||
ParentReferenceResultTypeProperty, | ||
requireNamedResultType, | ||
TableExpressionResultTypeProperty, | ||
TableFieldResultTypeProperty, | ||
} from '../result-type-specs'; | ||
import { SourceGenerationOptions } from '../../source-generation-options'; | ||
import { ResultTypesSource } from "../result-types-source"; | ||
import {SourceGenerationOptions} from '../../source-generation-options'; | ||
import {ResultTypesSource} from "../result-types-source"; | ||
@@ -188,9 +192,13 @@ export default function makeSource | ||
case 'clob': | ||
case 'uuid': | ||
return refTableFieldPropertyType(tfp, "String"); | ||
case 'timestamp with time zone': | ||
case 'timestamptz': | ||
return refTableFieldPropertyType(tfp, "Instant"); | ||
case 'timestamp': | ||
return refTableFieldPropertyType(tfp, "LocalDateTime"); | ||
case 'date': | ||
return refTableFieldPropertyType(tfp, "LocalDate"); | ||
case 'time': | ||
case 'timestamp': | ||
case 'timestamp with time zone': | ||
case 'timestamptz': | ||
case 'uuid': | ||
return textTableFieldPropertyType(tfp); | ||
return refTableFieldPropertyType(tfp, "LocalTime"); | ||
case 'bit': | ||
@@ -205,3 +213,3 @@ case 'boolean': | ||
if ( lcDbFieldType.startsWith('timestamp') ) | ||
return textTableFieldPropertyType(tfp); | ||
return refTableFieldPropertyType(tfp, "String"); | ||
else throw new Error(`unsupported type for field '${tfp.databaseFieldName}' of type '${tfp.databaseType}'`); | ||
@@ -315,2 +323,7 @@ } | ||
function refTableFieldPropertyType(fp: TableFieldResultTypeProperty, refType: string): string | ||
{ | ||
return withNullability(fp.nullable, refType); | ||
} | ||
function booleanTableFieldPropertyType(fp: TableFieldResultTypeProperty): string | ||
@@ -317,0 +330,0 @@ { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
632271
12019