You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a user, I want to select a subset of a database based on a SELECT and WHERE clause.
source:
database_subset:
database: publictable: ordersstrategy_name: querystrategy_options:
query: "SELECT * FROM public.table WHERE customer_id = 'abcdef' AND total_cost_usd > 50"
It means that we need to create a small SQL parser to build a conditional tree and filter on those conditions.
Examples of queries we can support:
SELECT * FROM public.table WHERE customer_id = 'abcdef';
SELECT * FROM public.table WHERE customer_id = 'abcdef' AND total_cost_usd > 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' AND total_cost_usd < 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' AND total_cost_usd <= 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' AND total_cost_usd >= 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' AND total_cost_usd != 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' OR total_cost_usd > 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' OR total_cost_usd < 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' OR total_cost_usd <= 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' OR total_cost_usd >= 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' OR total_cost_usd != 50;
As an improvement, we can put database_subset.database and database_subset.table parameters into database_subset.strategy_options. Then, they will be optional depending on the subset strategy taken.
The text was updated successfully, but these errors were encountered:
This feature would be amazing,
We have data that spans across schema and I doubt the current percentage strategy would work
Furthermore, this would guarantee some consistency over seed data
As a user, I want to select a subset of a database based on a SELECT and WHERE clause.
It means that we need to create a small SQL parser to build a conditional tree and filter on those conditions.
Examples of queries we can support:
SELECT * FROM public.table WHERE customer_id = 'abcdef';
SELECT * FROM public.table WHERE customer_id = 'abcdef' AND total_cost_usd > 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' AND total_cost_usd < 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' AND total_cost_usd <= 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' AND total_cost_usd >= 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' AND total_cost_usd != 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' OR total_cost_usd > 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' OR total_cost_usd < 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' OR total_cost_usd <= 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' OR total_cost_usd >= 50;
SELECT * FROM public.table WHERE customer_id = 'abcdef' OR total_cost_usd != 50;
As an improvement, we can put
database_subset.database
anddatabase_subset.table
parameters intodatabase_subset.strategy_options
. Then, they will be optional depending on the subset strategy taken.The text was updated successfully, but these errors were encountered: