File tree Expand file tree Collapse file tree 5 files changed +268
-193
lines changed Expand file tree Collapse file tree 5 files changed +268
-193
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,8 @@ const pgTypeToSwiftType = (
309
309
swiftType = 'Float'
310
310
} else if ( pgType === 'float8' ) {
311
311
swiftType = 'Double'
312
+ } else if ( [ 'numeric' , 'decimal' ] . includes ( pgType ) ) {
313
+ swiftType = 'Decimal'
312
314
} else if ( pgType === 'uuid' ) {
313
315
swiftType = 'UUID'
314
316
} else if (
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ CREATE TYPE composite_type_with_array_attribute AS (my_text_array text[]);
8
8
CREATE TABLE public .users (
9
9
id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY ,
10
10
name text ,
11
- status user_status DEFAULT ' ACTIVE'
11
+ status user_status DEFAULT ' ACTIVE' ,
12
+ decimal numeric
12
13
);
13
14
INSERT INTO
14
15
public .users (name)
Original file line number Diff line number Diff line change @@ -78,6 +78,24 @@ test('list', async () => {
78
78
"schema": "public",
79
79
"table": "users",
80
80
},
81
+ {
82
+ "check": null,
83
+ "comment": null,
84
+ "data_type": "numeric",
85
+ "default_value": null,
86
+ "enums": [],
87
+ "format": "numeric",
88
+ "identity_generation": null,
89
+ "is_generated": false,
90
+ "is_identity": false,
91
+ "is_nullable": true,
92
+ "is_unique": false,
93
+ "is_updatable": true,
94
+ "name": "decimal",
95
+ "ordinal_position": 4,
96
+ "schema": "public",
97
+ "table": "users",
98
+ },
81
99
{
82
100
"check": null,
83
101
"comment": null,
Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ test('query', async () => {
10
10
expect ( res . json ( ) ) . toMatchInlineSnapshot ( `
11
11
[
12
12
{
13
+ "decimal": null,
13
14
"id": 1,
14
15
"name": "Joe Bloggs",
15
16
"status": "ACTIVE",
16
17
},
17
18
{
19
+ "decimal": null,
18
20
"id": 2,
19
21
"name": "Jane Doe",
20
22
"status": "ACTIVE",
You can’t perform that action at this time.
0 commit comments