File tree Expand file tree Collapse file tree 2 files changed +35
-2
lines changed
packages/server/src/integration-test Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,7 @@ packages/builder/.routify
10
10
packages /sdk /sdk
11
11
packages /pro /coverage
12
12
** /* .ivm.bundle.js
13
- ! ** /bson-polyfills.ivm.bundle.js
13
+ ! ** /bson-polyfills.ivm.bundle.js
14
+ charts /
15
+ ** /* .hbs
16
+ packages /worker /src /constants /templates /tests /
Original file line number Diff line number Diff line change 1
- import { Datasource , FieldType , Table } from "@budibase/types"
1
+ import {
2
+ Datasource ,
3
+ FieldType ,
4
+ Table ,
5
+ StringFieldSubType ,
6
+ } from "@budibase/types"
2
7
import { generator } from "@budibase/backend-core/tests"
3
8
import {
4
9
DatabaseName ,
@@ -279,6 +284,31 @@ if (mainDescriptions.length) {
279
284
expect ( table ?. schema . email . externalType ) . toBe ( "USER-DEFINED" )
280
285
} )
281
286
} )
287
+
288
+ describe ( "text[] array field" , ( ) => {
289
+ const tableName = "textarraytable"
290
+ let table : Table
291
+
292
+ beforeAll ( async ( ) => {
293
+ await client . raw ( `
294
+ CREATE TABLE ${ tableName } (
295
+ id serial PRIMARY KEY,
296
+ tags text[]
297
+ )
298
+ ` )
299
+ const response = await config . api . datasource . fetchSchema ( {
300
+ datasourceId : datasource . _id ! ,
301
+ } )
302
+ table = response . datasource . entities ! [ tableName ]
303
+ } )
304
+
305
+ it ( "should map text[] column to internal type string with array subtype" , async ( ) => {
306
+ expect ( table ) . toBeDefined ( )
307
+ expect ( table ?. schema . tags . type ) . toBe ( FieldType . STRING )
308
+ expect ( table ?. schema . tags . subtype ) . toBe ( StringFieldSubType . ARRAY )
309
+ expect ( table ?. schema . tags . externalType ) . toBe ( "ARRAY" )
310
+ } )
311
+ } )
282
312
}
283
313
)
284
314
You can’t perform that action at this time.
0 commit comments