Skip to content

Commit 6036b77

Browse files
committed
helloworld
1 parent c8b4e0b commit 6036b77

File tree

22 files changed

+179
-199
lines changed

22 files changed

+179
-199
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
package:
16-
- rls-demo
16+
- hello-world
1717
- supabase
1818

1919
env:

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ npx supabase start
3535
pnpm install
3636

3737
# Run tests in watch mode
38-
cd packages/rls-demo
38+
cd packages/hello-world
3939
pnpm test:watch
4040
```
4141

@@ -44,7 +44,7 @@ pnpm test:watch
4444
This is a LaunchQL workspace combining `pnpm` and `lql` for modular Postgres packages:
4545

4646
- **`packages/supabase`** - Supabase-focused SQL, tests, and helpers
47-
- **`packages/rls-demo`** - Demo extension showcasing RLS with users/products
47+
- **`packages/hello-world`** - Demo extension showcasing RLS with users/products
4848

4949
## Testing
5050

@@ -55,7 +55,7 @@ Run tests in different modes:
5555
pnpm test
5656

5757
# Watch mode for specific package
58-
cd packages/rls-demo
58+
cd packages/hello-world
5959
pnpm test:watch
6060

6161
# Run Supabase package tests
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
EXTENSION = launchql-rls-demo
2-
DATA = sql/launchql-rls-demo--0.0.1.sql
1+
EXTENSION = hello-world
2+
DATA = sql/hello-world--0.0.1.sql
33

44
PG_CONFIG = pg_config
55
PGXS := $(shell $(PG_CONFIG) --pgxs)
File renamed without changes.
File renamed without changes.

packages/rls-demo/__tests__/seeding/data/seed-data.sql renamed to packages/hello-world/__tests__/seeding/data/seed-data.sql

File renamed without changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
id,email,created_at,updated_at
2+
550e8400-e29b-41d4-a716-446655440001,[email protected],2024-01-01T00:00:00Z,2024-01-01T00:00:00Z
3+
550e8400-e29b-41d4-a716-446655440002,[email protected],2024-01-01T00:00:00Z,2024-01-01T00:00:00Z
4+
550e8400-e29b-41d4-a716-446655440003,[email protected],2024-01-01T00:00:00Z,2024-01-01T00:00:00Z
5+
550e8400-e29b-41d4-a716-446655440004,[email protected],2024-01-01T00:00:00Z,2024-01-01T00:00:00Z

packages/rls-demo/__tests__/seeding/seeding.csv.test.ts renamed to packages/hello-world/__tests__/seeding/seeding.csv.test.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ beforeAll(async () => {
1616
seed.launchql(cwd),
1717
// load from csv
1818
seed.csv({
19-
'rls_test.user_profiles': csv('users.csv'),
20-
'rls_test.products': csv('products.csv')
19+
'auth.users': csv('users.csv')
20+
// 'rls_test.products': csv('products.csv')
2121
})
2222
]
2323
));
@@ -31,27 +31,27 @@ afterAll(async () => {
3131
// TODO: consider the supabase full schema
3232
describe('csv seeding', () => {
3333
it('has loaded rows from csv files', async () => {
34-
db.setContext({ role: 'service_role' });
34+
// db.setContext({ role: 'service_role' });
3535

36-
const usersRes = await pg.query('SELECT COUNT(*) FROM rls_test.user_profiles');
36+
const usersRes = await pg.query('SELECT COUNT(*) FROM auth.users');
3737
console.log('usersRes', usersRes);
3838
expect(+usersRes.rows[0].count).toBeGreaterThan(0);
3939

40-
const productsRes = await pg.query('SELECT COUNT(*) FROM rls_test.products');
41-
expect(+productsRes.rows[0].count).toBeGreaterThan(0);
42-
43-
// verify specific data was loaded
44-
const alice = await pg.one(
45-
`SELECT * FROM rls_test.user_profiles WHERE email = $1`,
46-
47-
);
48-
expect(alice.name).toBe('Alice Johnson');
49-
50-
const aliceProducts = await pg.query(
51-
`SELECT COUNT(*) FROM rls_test.products WHERE owner_id = $1`,
52-
[alice.id]
53-
);
54-
expect(+aliceProducts.rows[0].count).toBe(2);
40+
// const productsRes = await pg.query('SELECT COUNT(*) FROM rls_test.products');
41+
// expect(+productsRes.rows[0].count).toBeGreaterThan(0);
42+
43+
// // verify specific data was loaded
44+
// const alice = await pg.one(
45+
// `SELECT * FROM rls_test.user_profiles WHERE email = $1`,
46+
47+
// );
48+
// expect(alice.name).toBe('Alice Johnson');
49+
50+
// const aliceProducts = await pg.query(
51+
// `SELECT COUNT(*) FROM rls_test.products WHERE owner_id = $1`,
52+
// [alice.id]
53+
// );
54+
// expect(+aliceProducts.rows[0].count).toBe(2);
5555
});
5656
});
5757

packages/rls-demo/__tests__/seeding/seeding.sql.test.ts renamed to packages/hello-world/__tests__/seeding/seeding.sql.test.ts

File renamed without changes.

0 commit comments

Comments
 (0)