Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/data/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,30 @@ INSERT INTO animals (name, type, breed, color) VALUES ('Fluffy', 'cat', 'persian
INSERT INTO animals (name, type, breed, color) VALUES ('Rover', 'dog', 'bulldog', 'brown');
INSERT INTO animals (name, type, breed, color) VALUES ('Mittens', 'cat', 'maine coon', 'black');

-- Products table with JSONB columns for testing JSON filtering
CREATE TABLE product (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
attributes JSONB, -- Typed JSON for structured attributes
metadata JSONB, -- Dynamic Map for arbitrary data
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

-- Insert products with various JSON structures
INSERT INTO product (name, attributes, metadata) VALUES
('Widget',
'{"color": "red", "size": 10, "details": {"manufacturer": "Acme", "model": "Pro-100"}}',
'{"tags": ["sale", "featured"], "price": 99.99, "discount": "true"}'),
('Gadget',
'{"color": "blue", "size": 20, "details": {"manufacturer": "TechCo", "model": "Ultra-200"}}',
'{"tags": ["new"], "price": 149.99}'),
('Gizmo',
'{"color": "red", "size": 15, "details": {"manufacturer": "Acme", "model": "Basic-50"}}',
'{"tags": ["sale"], "price": 49.99, "discount": "true"}'),
('Tool',
'{"color": "green", "size": 5, "details": {"manufacturer": "ToolCorp", "model": "Mini-10"}}',
'{"tags": ["featured"], "price": 29.99}'),
('Device',
'{"color": "blue", "size": 25, "details": {"manufacturer": "TechCo", "model": "Pro-300"}}',
'{"tags": ["new", "featured"], "price": 199.99, "rating": 4.5}');

Loading
Loading