Skip to content

Commit 6b251d6

Browse files
committed
fix: tests
1 parent d6626b4 commit 6b251d6

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/lib/sql/functions.sql.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ from
177177
) as t2
178178
left join pg_type pt on pt.oid = t1.type_id
179179
left join pg_class pc on pc.oid = pt.typrelid
180+
order by t1.name asc
180181
) sub
181182
group by
182183
oid

test/server/typegen.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4309,9 +4309,9 @@ test('typegen: typescript consistent types definitions orders', async () => {
43094309
DROP FUNCTION IF EXISTS test_func_gamma(integer, text, boolean) CASCADE;
43104310
43114311
-- Alternative signatures for functions (different parameter orders)
4312-
DROP FUNCTION IF EXISTS test_func_alpha(text, boolean, integer) CASCADE;
4313-
DROP FUNCTION IF EXISTS test_func_beta(boolean, integer, text) CASCADE;
4314-
DROP FUNCTION IF EXISTS test_func_gamma(boolean, text, integer) CASCADE;
4312+
DROP FUNCTION IF EXISTS test_func_alpha_2(boolean, text, integer) CASCADE;
4313+
DROP FUNCTION IF EXISTS test_func_beta_2(text, boolean, integer) CASCADE;
4314+
DROP FUNCTION IF EXISTS test_func_gamma_2(boolean, integer, text) CASCADE;
43154315
43164316
-- Drop tables
43174317
DROP TABLE IF EXISTS test_table_alpha CASCADE;
@@ -4481,19 +4481,19 @@ test('typegen: typescript consistent types definitions orders', async () => {
44814481
},
44824482
})
44834483

4484-
// Create functions in reverse order: gamma, beta, alpha with different parameter orders
4484+
// Create functions in reverse order: gamma, beta, alpha with same parameter orders
44854485
await app.inject({
44864486
method: 'POST',
44874487
path: '/query',
44884488
payload: {
44894489
query: `
4490-
CREATE FUNCTION test_func_gamma(param_c boolean, param_a integer, param_b text)
4490+
CREATE FUNCTION test_func_gamma(param_a integer, param_b text, param_c boolean)
44914491
RETURNS boolean AS 'SELECT NOT param_c' LANGUAGE sql IMMUTABLE;
44924492
4493-
CREATE FUNCTION test_func_beta(param_b text, param_c boolean, param_a integer)
4493+
CREATE FUNCTION test_func_beta(param_a integer, param_b text, param_c boolean)
44944494
RETURNS text AS 'SELECT param_b || ''_processed''' LANGUAGE sql IMMUTABLE;
44954495
4496-
CREATE FUNCTION test_func_alpha(param_c boolean, param_b text, param_a integer)
4496+
CREATE FUNCTION test_func_alpha(param_a integer, param_b text, param_c boolean)
44974497
RETURNS integer AS 'SELECT param_a + 1' LANGUAGE sql IMMUTABLE;
44984498
`,
44994499
},

0 commit comments

Comments
 (0)