Skip to content

Commit b0a77e3

Browse files
committed
Test CJK
1 parent d0e6f1b commit b0a77e3

File tree

9 files changed

+1605
-1
lines changed

9 files changed

+1605
-1
lines changed

postgraphile/postgraphile/__tests__/kitchen-sink-data.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ delete from issue_2212.orders cascade;
9797
delete from issue_2212.user_contacts cascade;
9898
delete from issue_2212.users cascade;
9999
delete from function_returning_enum.applicants cascade;
100+
delete from cjk."期间" cascade;
100101

101102
alter table b.types enable trigger user;
102103

@@ -1183,3 +1184,9 @@ insert into function_returning_enum.applicants(
11831184
(1, 'John', 'Doe', 'round 2', 'CAT', 'BIKE' ),
11841185
(2, 'David', 'Bowie', 'round 2', 'DOG', 'SUBWAY'),
11851186
(3, 'John', 'Lennon', 'round 1', 'CAT', 'CAR');
1187+
1188+
--------------------------------------------------------------------------------
1189+
1190+
insert into cjk."期间" (id, "期间") values
1191+
(1, 21),
1192+
(2, 22);

postgraphile/postgraphile/__tests__/kitchen-sink-schema.sql

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ drop schema if exists
2828
issue_2212,
2929
issue_2287,
3030
issue_2334,
31-
relay
31+
relay,
32+
cjk
3233
cascade;
3334
drop extension if exists tablefunc;
3435
drop extension if exists intarray;
@@ -2552,3 +2553,12 @@ create schema no_fields;
25522553
create table no_fields.citation (
25532554
id integer primary key generated always as identity
25542555
);
2556+
2557+
--------------------------------------------------------------------------------
2558+
2559+
create schema cjk;
2560+
2561+
create table cjk."期间" (
2562+
id serial primary key,
2563+
"期间" int
2564+
);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
allQiJians: {
3+
nodes: [
4+
{
5+
id: 1,
6+
qiJian: 21,
7+
},
8+
{
9+
id: 2,
10+
qiJian: 22,
11+
},
12+
],
13+
},
14+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
2+
graph TD
3+
classDef path fill:#eee,stroke:#000,color:#000
4+
classDef plan fill:#fff,stroke-width:1px,color:#000
5+
classDef itemplan fill:#fff,stroke-width:2px,color:#000
6+
classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
7+
classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
8+
classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left
9+
10+
subgraph "Buckets for queries/v4/cjk"
11+
Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: Access[9], Access[10], Object[11]<br />2: PgSelect[8]<br />3: Connection[12]<br />4: ConnectionItems[14]"):::bucket
12+
Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 12, 14<br /><br />ROOT Connectionᐸ8ᐳ[12]"):::bucket
13+
Bucket3("Bucket 3 (listItem)<br /><br />ROOT __Item{3}ᐸ14ᐳ[17]"):::bucket
14+
Bucket4("Bucket 4 (nullableBoundary)<br />Deps: 18<br /><br />ROOT PgSelectSingle{3}ᐸ期间ᐳ[18]"):::bucket
15+
end
16+
Bucket0 --> Bucket1
17+
Bucket1 --> Bucket3
18+
Bucket3 --> Bucket4
19+
20+
%% plan dependencies
21+
Object11{{"Object[11∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
22+
Access9{{"Access[9∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
23+
Access10{{"Access[10∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
24+
Access9 & Access10 --> Object11
25+
PgSelect8[["PgSelect[8∈0] ➊<br />ᐸ期间ᐳ"]]:::plan
26+
Object11 --> PgSelect8
27+
__Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
28+
__Value2 --> Access9
29+
__Value2 --> Access10
30+
Connection12[["Connection[12∈0] ➊<br />ᐸ8ᐳ"]]:::plan
31+
PgSelect8 --> Connection12
32+
ConnectionItems14[["ConnectionItems[14∈0] ➊"]]:::plan
33+
Connection12 --> ConnectionItems14
34+
__Item17[/"__Item[17∈3]<br />ᐸ14ᐳ"\]:::itemplan
35+
ConnectionItems14 ==> __Item17
36+
PgSelectSingle18{{"PgSelectSingle[18∈3]<br />ᐸ期间ᐳ"}}:::plan
37+
__Item17 --> PgSelectSingle18
38+
PgClassExpression19{{"PgClassExpression[19∈4]<br />ᐸ__local__.”id”ᐳ"}}:::plan
39+
PgSelectSingle18 --> PgClassExpression19
40+
PgClassExpression20{{"PgClassExpression[20∈4]<br />ᐸ__local__.”期间”ᐳ"}}:::plan
41+
PgClassExpression19 o--o PgClassExpression20
42+
43+
%% define steps
44+
classDef bucket0 stroke:#696969
45+
class Bucket0,__Value2,PgSelect8,Access9,Access10,Object11,Connection12,ConnectionItems14 bucket0
46+
classDef bucket1 stroke:#00bfff
47+
class Bucket1 bucket1
48+
classDef bucket3 stroke:#ffa500
49+
class Bucket3,__Item17,PgSelectSingle18 bucket3
50+
classDef bucket4 stroke:#0000ff
51+
class Bucket4,PgClassExpression19,PgClassExpression20 bucket4
52+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
select
2+
__local__."id"::text as "0",
3+
__local__."期间"::text as "1"
4+
from "cjk"."期间" as __local__
5+
order by __local__."id" asc;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## expect(errors).toBeFalsy();
2+
#> schema: ['cjk']
3+
{
4+
allQiJians {
5+
nodes {
6+
... on QiJian {
7+
id
8+
qiJian
9+
}
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)