metal-orm 1.0.23 → 1.0.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metal-orm",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "bin": {
@@ -168,9 +168,12 @@ const parseColumnType = colTypeRaw => {
168
168
 
169
169
  const base = type.replace(/\(.*\)/, '');
170
170
 
171
+ if (base === 'bit') return { factory: 'col.boolean()', ts: 'boolean' };
171
172
  if (base.includes('bigint')) return { factory: 'col.bigint()', ts: 'number' };
172
173
  if (base.includes('int')) return { factory: 'col.int()', ts: 'number' };
173
- if (base.includes('uuid')) return { factory: 'col.uuid()', ts: 'string' };
174
+ if (base.includes('uuid') || base.includes('uniqueidentifier')) return { factory: 'col.uuid()', ts: 'string' };
175
+ if (base === 'date') return { factory: 'col.date()', ts: 'Date' };
176
+ if (base.includes('datetime') || base === 'time') return { factory: 'col.datetime()', ts: 'Date' };
174
177
  if (base.includes('char') || base.includes('text')) {
175
178
  const lenArg = length ? `${length}` : '255';
176
179
  return { factory: `col.varchar(${lenArg})`, ts: 'string' };