sql-typechecker 0.0.33 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/cli.js +43 -0
- package/out/cli.js.map +2 -2
- package/package.json +1 -1
package/out/cli.js
CHANGED
|
@@ -241954,6 +241954,9 @@ function unifyCallGeneral(call, argTypes, expectedArgs, returnT) {
|
|
|
241954
241954
|
return returnT;
|
|
241955
241955
|
}
|
|
241956
241956
|
function castScalars(e, source, target, type) {
|
|
241957
|
+
if (type === "explicit" && eqType(source, BuiltinTypes.Text)) {
|
|
241958
|
+
return;
|
|
241959
|
+
}
|
|
241957
241960
|
const matchingCast = findMatchingCast([source.name], source, target, type);
|
|
241958
241961
|
if (matchingCast === null) {
|
|
241959
241962
|
throw new TypeMismatch(e, {expected: target, actual: source});
|
|
@@ -242906,6 +242909,38 @@ function elabCall(g, c, e) {
|
|
|
242906
242909
|
throw new InvalidArguments(e, e.function, argTypes);
|
|
242907
242910
|
}
|
|
242908
242911
|
}
|
|
242912
|
+
if (eqQNames(e.function, {name: "generate_series"})) {
|
|
242913
|
+
return unifyOverloadedCall(e, argTypes, [
|
|
242914
|
+
{
|
|
242915
|
+
expectedArgs: [BuiltinTypes.Integer, BuiltinTypes.Integer],
|
|
242916
|
+
returnT: BuiltinTypeConstructors.Array(BuiltinTypes.Integer)
|
|
242917
|
+
},
|
|
242918
|
+
{
|
|
242919
|
+
expectedArgs: [
|
|
242920
|
+
BuiltinTypes.Integer,
|
|
242921
|
+
BuiltinTypes.Integer,
|
|
242922
|
+
BuiltinTypes.Integer
|
|
242923
|
+
],
|
|
242924
|
+
returnT: BuiltinTypeConstructors.Array(BuiltinTypes.Integer)
|
|
242925
|
+
},
|
|
242926
|
+
{
|
|
242927
|
+
expectedArgs: [
|
|
242928
|
+
BuiltinTypes.Timestamp,
|
|
242929
|
+
BuiltinTypes.Timestamp,
|
|
242930
|
+
BuiltinTypes.Interval
|
|
242931
|
+
],
|
|
242932
|
+
returnT: BuiltinTypeConstructors.Array(BuiltinTypes.Timestamp)
|
|
242933
|
+
},
|
|
242934
|
+
{
|
|
242935
|
+
expectedArgs: [
|
|
242936
|
+
BuiltinTypes.Date,
|
|
242937
|
+
BuiltinTypes.Date,
|
|
242938
|
+
BuiltinTypes.Interval
|
|
242939
|
+
],
|
|
242940
|
+
returnT: BuiltinTypeConstructors.Array(BuiltinTypes.Date)
|
|
242941
|
+
}
|
|
242942
|
+
]);
|
|
242943
|
+
}
|
|
242909
242944
|
if (eqQNames(e.function, {name: "to_char"})) {
|
|
242910
242945
|
if (isNullable(argTypes[0])) {
|
|
242911
242946
|
return nullify(unifyOverloadedCall(e, [unnullify(argTypes[0])], [
|
|
@@ -242920,6 +242955,10 @@ function elabCall(g, c, e) {
|
|
|
242920
242955
|
{
|
|
242921
242956
|
expectedArgs: [BuiltinTypes.Timestamp],
|
|
242922
242957
|
returnT: BuiltinTypes.Text
|
|
242958
|
+
},
|
|
242959
|
+
{
|
|
242960
|
+
expectedArgs: [BuiltinTypes.Date],
|
|
242961
|
+
returnT: BuiltinTypes.Text
|
|
242923
242962
|
}
|
|
242924
242963
|
]));
|
|
242925
242964
|
} else {
|
|
@@ -242929,6 +242968,10 @@ function elabCall(g, c, e) {
|
|
|
242929
242968
|
{
|
|
242930
242969
|
expectedArgs: [BuiltinTypes.Timestamp],
|
|
242931
242970
|
returnT: BuiltinTypes.Text
|
|
242971
|
+
},
|
|
242972
|
+
{
|
|
242973
|
+
expectedArgs: [BuiltinTypes.Date],
|
|
242974
|
+
returnT: BuiltinTypes.Text
|
|
242932
242975
|
}
|
|
242933
242976
|
]);
|
|
242934
242977
|
}
|