@mlagie/sql-connector 2.1.1 → 2.1.2
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/index.d.ts +6 -4
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -40,9 +40,7 @@ export interface SchemaDict {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
type NormalizeSqlType<T> =
|
|
43
|
-
T extends
|
|
44
|
-
? NormalizeSqlType<Name>
|
|
45
|
-
: T extends StringConstructor
|
|
43
|
+
T extends StringConstructor
|
|
46
44
|
? "String"
|
|
47
45
|
: T extends NumberConstructor
|
|
48
46
|
? "Number"
|
|
@@ -56,7 +54,9 @@ type NormalizeSqlType<T> =
|
|
|
56
54
|
? "Array"
|
|
57
55
|
: T extends SqlType
|
|
58
56
|
? T
|
|
59
|
-
:
|
|
57
|
+
: T extends { name: SqlType }
|
|
58
|
+
? T["name"]
|
|
59
|
+
: never;
|
|
60
60
|
|
|
61
61
|
type InferSqlType<T> =
|
|
62
62
|
NormalizeSqlType<T> extends "String" | "Text"
|
|
@@ -85,6 +85,8 @@ type InferFieldNullable<TField> =
|
|
|
85
85
|
? false
|
|
86
86
|
: TField extends { auto_increment: true }
|
|
87
87
|
? false
|
|
88
|
+
: TField extends { default: null }
|
|
89
|
+
? true
|
|
88
90
|
: HasKey<TField, "default"> extends true
|
|
89
91
|
? false
|
|
90
92
|
: true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlagie/sql-connector",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "The sql-connector module allows you to manage connections to a MySQL database, define table schemas, and interact with data in a simple and efficient way.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|