-- Fetch all the Orders belonging to the BigCommerce
-- account of a particular user.
SELECT *
FROM fiber.bigcommerce_order
WHERE account_id = '{user.bigcommerce_id}'
-- Fetch all the Orders belonging to the BigCommerce
-- account of a particular user.
SELECT *
FROM fiber.bigcommerce_order
WHERE account_id = '{user.bigcommerce_id}'
Code
CREATE TABLE fiber.bigcommerce_order (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
date_modified TEXT,
date_shipped TEXT,
cart_id TEXT,
consignments JSONB,
status TEXT,
subtotal_tax TEXT,
shipping_cost_tax TEXT,
shipping_cost_tax_class_id TEXT,
handling_cost_tax TEXT,
handling_cost_tax_class_id TEXT,
wrapping_cost_tax TEXT,
wrapping_cost_tax_class_id TEXT,
payment_status TEXT,
store_credit_amount TEXT,
gift_certificate_amount TEXT,
currency_id TEXT,
currency_code TEXT,
currency_exchange_rate TEXT,
default_currency_id TEXT,
coupon_discount TEXT,
shipping_address_count INT,
is_email_opt_in BOOLEAN,
order_source TEXT,
products JSONB,
shipping_addresses JSONB,
coupons JSONB,
status_id TEXT,
base_handling_cost TEXT,
base_shipping_cost TEXT,
base_wrapping_cost TEXT,
billing_address JSONB,
channel_id TEXT,
customer_id TEXT,
customer_message TEXT,
date_created TEXT,
default_currency_code TEXT,
discount_amount TEXT,
ebay_order_id TEXT,
external_source TEXT,
geoip_country TEXT,
geoip_country_iso_2 TEXT,
handling_cost_ex_tax TEXT,
handling_cost_inc_tax TEXT,
ip_address TEXT,
is_deleted BOOLEAN,
items_shipped INT,
items_total INT,
order_is_digital BOOLEAN,
payment_method TEXT,
refunded_amount TEXT,
shipping_cost_ex_tax TEXT,
shipping_cost_inc_tax TEXT,
staff_notes TEXT,
subtotal_ex_tax TEXT,
subtotal_inc_tax TEXT,
tax_provider_id TEXT,
customer_locale TEXT,
total_ex_tax TEXT,
total_inc_tax TEXT,
wrapping_cost_ex_tax TEXT,
wrapping_cost_inc_tax TEXT
)
CREATE TABLE fiber.bigcommerce_order (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
date_modified TEXT,
date_shipped TEXT,
cart_id TEXT,
consignments JSONB,
status TEXT,
subtotal_tax TEXT,
shipping_cost_tax TEXT,
shipping_cost_tax_class_id TEXT,
handling_cost_tax TEXT,
handling_cost_tax_class_id TEXT,
wrapping_cost_tax TEXT,
wrapping_cost_tax_class_id TEXT,
payment_status TEXT,
store_credit_amount TEXT,
gift_certificate_amount TEXT,
currency_id TEXT,
currency_code TEXT,
currency_exchange_rate TEXT,
default_currency_id TEXT,
coupon_discount TEXT,
shipping_address_count INT,
is_email_opt_in BOOLEAN,
order_source TEXT,
products JSONB,
shipping_addresses JSONB,
coupons JSONB,
status_id TEXT,
base_handling_cost TEXT,
base_shipping_cost TEXT,
base_wrapping_cost TEXT,
billing_address JSONB,
channel_id TEXT,
customer_id TEXT,
customer_message TEXT,
date_created TEXT,
default_currency_code TEXT,
discount_amount TEXT,
ebay_order_id TEXT,
external_source TEXT,
geoip_country TEXT,
geoip_country_iso_2 TEXT,
handling_cost_ex_tax TEXT,
handling_cost_inc_tax TEXT,
ip_address TEXT,
is_deleted BOOLEAN,
items_shipped INT,
items_total INT,
order_is_digital BOOLEAN,
payment_method TEXT,
refunded_amount TEXT,
shipping_cost_ex_tax TEXT,
shipping_cost_inc_tax TEXT,
staff_notes TEXT,
subtotal_ex_tax TEXT,
subtotal_inc_tax TEXT,
tax_provider_id TEXT,
customer_locale TEXT,
total_ex_tax TEXT,
total_inc_tax TEXT,
wrapping_cost_ex_tax TEXT,
wrapping_cost_inc_tax TEXT
)
Model definition