Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitRanque committed Dec 5, 2024
1 parent 72a609e commit f357cc0
Show file tree
Hide file tree
Showing 8 changed files with 4,691 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: crates/tests/databases-tests/src/postgres/cli_version3_tests.rs
expression: default_configuration
snapshot_kind: text
---
{
"version": "3",
Expand Down Expand Up @@ -1070,6 +1071,31 @@ expression: default_configuration
"foreignRelations": {},
"description": null
},
"text_table": {
"schemaName": "public",
"tableName": "text",
"columns": {
"content": {
"name": "content",
"type": {
"scalarType": "text"
},
"nullable": "nullable",
"description": null
},
"id": {
"name": "id",
"type": {
"scalarType": "int4"
},
"nullable": "nullable",
"description": null
}
},
"uniquenessConstraints": {},
"foreignRelations": {},
"description": null
},
"topology_layer": {
"schemaName": "topology",
"tableName": "layer",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: crates/tests/databases-tests/src/postgres/cli_version4_tests.rs
expression: default_configuration
snapshot_kind: text
---
{
"version": "4",
Expand Down Expand Up @@ -1135,6 +1136,31 @@ expression: default_configuration
"foreignRelations": {},
"description": null
},
"text_table": {
"schemaName": "public",
"tableName": "text",
"columns": {
"content": {
"name": "content",
"type": {
"scalarType": "text"
},
"nullable": "nullable",
"description": null
},
"id": {
"name": "id",
"type": {
"scalarType": "int4"
},
"nullable": "nullable",
"description": null
}
},
"uniquenessConstraints": {},
"foreignRelations": {},
"description": null
},
"topology_layer": {
"schemaName": "topology",
"tableName": "layer",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: crates/tests/databases-tests/src/postgres/cli_version5_tests.rs
expression: default_configuration
snapshot_kind: text
---
{
"version": "5",
Expand Down Expand Up @@ -1135,6 +1136,31 @@ expression: default_configuration
"foreignRelations": {},
"description": null
},
"text_table": {
"schemaName": "public",
"tableName": "text",
"columns": {
"content": {
"name": "content",
"type": {
"scalarType": "text"
},
"nullable": "nullable",
"description": null
},
"id": {
"name": "id",
"type": {
"scalarType": "int4"
},
"nullable": "nullable",
"description": null
}
},
"uniquenessConstraints": {},
"foreignRelations": {},
"description": null
},
"topology_layer": {
"schemaName": "topology",
"tableName": "layer",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: crates/tests/databases-tests/src/postgres/schema_tests.rs
expression: result
snapshot_kind: text
---
{
"scalar_types": {
Expand Down Expand Up @@ -5415,6 +5416,50 @@ expression: result
}
}
},
"insert_text_table_object": {
"fields": {
"content": {
"type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "text"
}
}
},
"id": {
"type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "int4"
}
}
}
}
},
"insert_text_table_response": {
"description": "Responses from the 'insert_text_table' procedure",
"fields": {
"affected_rows": {
"description": "The number of rows affected by the mutation",
"type": {
"type": "named",
"name": "int4"
}
},
"returning": {
"description": "Data from rows affected by the mutation",
"type": {
"type": "array",
"element_type": {
"type": "named",
"name": "text_table"
}
}
}
}
},
"insert_topology_layer_object": {
"fields": {
"child_id": {
Expand Down Expand Up @@ -5949,6 +5994,28 @@ expression: result
}
}
},
"text_table": {
"fields": {
"content": {
"type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "text"
}
}
},
"id": {
"type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "int4"
}
}
}
}
},
"topology_layer": {
"fields": {
"child_id": {
Expand Down Expand Up @@ -9385,6 +9452,13 @@ expression: result
},
"foreign_keys": {}
},
{
"name": "text_table",
"arguments": {},
"type": "text_table",
"uniqueness_constraints": {},
"foreign_keys": {}
},
{
"name": "topology_layer",
"arguments": {},
Expand Down Expand Up @@ -11007,6 +11081,35 @@ expression: result
"name": "insert_spatial_ref_sys_response"
}
},
{
"name": "insert_text_table",
"description": "Insert into the text_table table",
"arguments": {
"objects": {
"type": {
"type": "array",
"element_type": {
"type": "named",
"name": "insert_text_table_object"
}
}
},
"post_check": {
"description": "Insert permission predicate over the 'text_table' collection",
"type": {
"type": "nullable",
"underlying_type": {
"type": "predicate",
"object_type_name": "text_table"
}
}
}
},
"result_type": {
"type": "named",
"name": "insert_text_table_response"
}
},
{
"name": "insert_topology_layer",
"description": "Insert into the topology_layer table",
Expand Down
3 changes: 3 additions & 0 deletions static/custom-tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ create table custom.defaults (

create table custom.test_cidr (ip CIDR, service text);
insert into custom.test_cidr values('64.6.64.0/24', 'my_service');

-- this table name intentionally conflicts with the scalar `text` type
create table text(id int, content text);
Loading

0 comments on commit f357cc0

Please sign in to comment.