-- Fetch all the Orders belonging to the WooCommerce
-- account of a particular user.
SELECT *
FROM fiber.woocommerce_order
WHERE account_id = '{user.woocommerce_id}'
-- Fetch all the Orders belonging to the WooCommerce
-- account of a particular user.
SELECT *
FROM fiber.woocommerce_order
WHERE account_id = '{user.woocommerce_id}'
Code
CREATE TABLE fiber.woocommerce_order (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
parent_id TEXT,
number TEXT,
order_key TEXT,
created_via TEXT,
version TEXT,
status TEXT,
currency TEXT,
date_created TIMESTAMP WITH TIME ZONE,
date_created_gmt TIMESTAMP WITH TIME ZONE,
date_modified TIMESTAMP WITH TIME ZONE,
date_modified_gmt TIMESTAMP WITH TIME ZONE,
discount_total TEXT,
discount_tax TEXT,
shipping_total TEXT,
shipping_tax TEXT,
cart_tax TEXT,
total TEXT,
total_tax TEXT,
prices_include_tax BOOLEAN,
customer_id TEXT,
customer_ip_address TEXT,
customer_user_agent TEXT,
customer_note TEXT,
billing JSONB,
shipping JSONB,
payment_method TEXT,
payment_method_title TEXT,
transaction_id TEXT,
date_paid TIMESTAMP WITH TIME ZONE,
date_paid_gmt TIMESTAMP WITH TIME ZONE,
date_completed TIMESTAMP WITH TIME ZONE,
date_completed_gmt TEXT,
cart_hash TEXT,
meta_data JSONB,
line_items JSONB,
tax_lines JSONB,
shipping_lines JSONB,
fee_lines JSONB,
coupon_lines JSONB,
refunds JSONB,
links JSONB
)
CREATE TABLE fiber.woocommerce_order (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
parent_id TEXT,
number TEXT,
order_key TEXT,
created_via TEXT,
version TEXT,
status TEXT,
currency TEXT,
date_created TIMESTAMP WITH TIME ZONE,
date_created_gmt TIMESTAMP WITH TIME ZONE,
date_modified TIMESTAMP WITH TIME ZONE,
date_modified_gmt TIMESTAMP WITH TIME ZONE,
discount_total TEXT,
discount_tax TEXT,
shipping_total TEXT,
shipping_tax TEXT,
cart_tax TEXT,
total TEXT,
total_tax TEXT,
prices_include_tax BOOLEAN,
customer_id TEXT,
customer_ip_address TEXT,
customer_user_agent TEXT,
customer_note TEXT,
billing JSONB,
shipping JSONB,
payment_method TEXT,
payment_method_title TEXT,
transaction_id TEXT,
date_paid TIMESTAMP WITH TIME ZONE,
date_paid_gmt TIMESTAMP WITH TIME ZONE,
date_completed TIMESTAMP WITH TIME ZONE,
date_completed_gmt TEXT,
cart_hash TEXT,
meta_data JSONB,
line_items JSONB,
tax_lines JSONB,
shipping_lines JSONB,
fee_lines JSONB,
coupon_lines JSONB,
refunds JSONB,
links JSONB
)
Model definition