-- Fetch all the Orders belonging to the Shopify
-- store of a particular user.
SELECT *
FROM fiber.shopify_order
WHERE store_id = '{user.store_id}'
-- Fetch all the Orders belonging to the Shopify
-- store of a particular user.
SELECT *
FROM fiber.shopify_order
WHERE store_id = '{user.store_id}'
Code
CREATE TABLE fiber.shopify_order (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
store_id TEXT,
admin_graphql_api_id TEXT,
app_id TEXT,
browser_ip TEXT,
buyer_accepts_marketing BOOLEAN,
cancel_reason TEXT,
cancelled_at TIMESTAMP WITH TIME ZONE,
cart_token TEXT,
checkout_id TEXT,
checkout_token TEXT,
client_details JSONB,
closed_at TIMESTAMP WITH TIME ZONE,
confirmed BOOLEAN,
contact_email TEXT,
currency TEXT,
current_subtotal_price DOUBLE PRECISION,
current_subtotal_price_set JSONB,
current_total_discounts DOUBLE PRECISION,
current_total_discounts_set JSONB,
current_total_duties_set TEXT,
current_total_price DOUBLE PRECISION,
current_total_price_set JSONB,
current_total_tax DOUBLE PRECISION,
current_total_tax_set JSONB,
customer_locale TEXT,
device_id TEXT,
discount_codes JSONB,
email TEXT,
financial_status TEXT,
fulfillment_status TEXT,
gateway TEXT,
landing_site TEXT,
landing_site_ref TEXT,
location_id TEXT,
name TEXT,
note TEXT,
note_attributes JSONB,
number INT,
order_number INT,
order_status_url TEXT,
original_total_duties_set TEXT,
payment_gateway_names TEXT[],
phone TEXT,
presentment_currency TEXT,
processed_at TIMESTAMP WITH TIME ZONE,
processing_method TEXT,
reference TEXT,
referring_site TEXT,
source_identifier TEXT,
source_name TEXT,
source_url TEXT,
shop_url TEXT,
subtotal_price DOUBLE PRECISION,
subtotal_price_set JSONB,
tags TEXT,
tax_lines JSONB,
taxes_included BOOLEAN,
test BOOLEAN,
token TEXT,
total_discounts DOUBLE PRECISION,
total_discounts_set JSONB,
total_line_items_price DOUBLE PRECISION,
total_line_items_price_set JSONB,
total_outstanding DOUBLE PRECISION,
total_price DOUBLE PRECISION,
total_price_set JSONB,
total_price_usd DOUBLE PRECISION,
total_shipping_price_set JSONB,
total_tax DOUBLE PRECISION,
total_tax_set JSONB,
total_tip_received DOUBLE PRECISION,
total_weight INT,
user_id TEXT,
billing_address JSONB,
customer JSONB,
discount_allocations JSONB,
fulfillments JSONB,
line_items JSONB,
payment_details JSONB,
refunds JSONB,
shipping_address JSONB,
shipping_lines JSONB
)
CREATE TABLE fiber.shopify_order (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
store_id TEXT,
admin_graphql_api_id TEXT,
app_id TEXT,
browser_ip TEXT,
buyer_accepts_marketing BOOLEAN,
cancel_reason TEXT,
cancelled_at TIMESTAMP WITH TIME ZONE,
cart_token TEXT,
checkout_id TEXT,
checkout_token TEXT,
client_details JSONB,
closed_at TIMESTAMP WITH TIME ZONE,
confirmed BOOLEAN,
contact_email TEXT,
currency TEXT,
current_subtotal_price DOUBLE PRECISION,
current_subtotal_price_set JSONB,
current_total_discounts DOUBLE PRECISION,
current_total_discounts_set JSONB,
current_total_duties_set TEXT,
current_total_price DOUBLE PRECISION,
current_total_price_set JSONB,
current_total_tax DOUBLE PRECISION,
current_total_tax_set JSONB,
customer_locale TEXT,
device_id TEXT,
discount_codes JSONB,
email TEXT,
financial_status TEXT,
fulfillment_status TEXT,
gateway TEXT,
landing_site TEXT,
landing_site_ref TEXT,
location_id TEXT,
name TEXT,
note TEXT,
note_attributes JSONB,
number INT,
order_number INT,
order_status_url TEXT,
original_total_duties_set TEXT,
payment_gateway_names TEXT[],
phone TEXT,
presentment_currency TEXT,
processed_at TIMESTAMP WITH TIME ZONE,
processing_method TEXT,
reference TEXT,
referring_site TEXT,
source_identifier TEXT,
source_name TEXT,
source_url TEXT,
shop_url TEXT,
subtotal_price DOUBLE PRECISION,
subtotal_price_set JSONB,
tags TEXT,
tax_lines JSONB,
taxes_included BOOLEAN,
test BOOLEAN,
token TEXT,
total_discounts DOUBLE PRECISION,
total_discounts_set JSONB,
total_line_items_price DOUBLE PRECISION,
total_line_items_price_set JSONB,
total_outstanding DOUBLE PRECISION,
total_price DOUBLE PRECISION,
total_price_set JSONB,
total_price_usd DOUBLE PRECISION,
total_shipping_price_set JSONB,
total_tax DOUBLE PRECISION,
total_tax_set JSONB,
total_tip_received DOUBLE PRECISION,
total_weight INT,
user_id TEXT,
billing_address JSONB,
customer JSONB,
discount_allocations JSONB,
fulfillments JSONB,
line_items JSONB,
payment_details JSONB,
refunds JSONB,
shipping_address JSONB,
shipping_lines JSONB
)
Model definition