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 = (
309309 swiftType = 'Float'
310310 } else if ( pgType === 'float8' ) {
311311 swiftType = 'Double'
312+ } else if ( [ 'numeric' , 'decimal' ] . includes ( pgType ) ) {
313+ swiftType = 'Decimal'
312314 } else if ( pgType === 'uuid' ) {
313315 swiftType = 'UUID'
314316 } 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[]);
88CREATE TABLE public .users (
99 id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY ,
1010 name text ,
11- status user_status DEFAULT ' ACTIVE'
11+ status user_status DEFAULT ' ACTIVE' ,
12+ decimal numeric
1213);
1314INSERT INTO
1415 public .users (name)
Original file line number Diff line number Diff line change @@ -78,6 +78,24 @@ test('list', async () => {
7878 "schema": "public",
7979 "table": "users",
8080 },
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+ },
8199 {
82100 "check": null,
83101 "comment": null,
Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ test('query', async () => {
1010 expect ( res . json ( ) ) . toMatchInlineSnapshot ( `
1111 [
1212 {
13+ "decimal": null,
1314 "id": 1,
1415 "name": "Joe Bloggs",
1516 "status": "ACTIVE",
1617 },
1718 {
19+ "decimal": null,
1820 "id": 2,
1921 "name": "Jane Doe",
2022 "status": "ACTIVE",
You can’t perform that action at this time.
0 commit comments