-- Fetch all the Campaigns belonging to the Klaviyo
-- account of a particular user.
SELECT *
FROM fiber.klaviyo_campaign
WHERE account_id = '{user.klaviyo_id}'
-- Fetch all the Campaigns belonging to the Klaviyo
-- account of a particular user.
SELECT *
FROM fiber.klaviyo_campaign
WHERE account_id = '{user.klaviyo_id}'
Code
CREATE TABLE fiber.klaviyo_campaign (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
status TEXT,
updated TEXT,
from_name TEXT,
list_id TEXT,
template JSONB,
status_id TEXT,
object TEXT,
num_recipients INT,
lists JSONB,
is_segmented BOOLEAN,
send_time TEXT,
excluded_lists JSONB,
sent_at TEXT,
campaign_type TEXT,
name TEXT,
created TEXT,
status_label TEXT,
from_email TEXT,
subject TEXT,
message_type TEXT,
template_id TEXT
)
CREATE TABLE fiber.klaviyo_campaign (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
status TEXT,
updated TEXT,
from_name TEXT,
list_id TEXT,
template JSONB,
status_id TEXT,
object TEXT,
num_recipients INT,
lists JSONB,
is_segmented BOOLEAN,
send_time TEXT,
excluded_lists JSONB,
sent_at TEXT,
campaign_type TEXT,
name TEXT,
created TEXT,
status_label TEXT,
from_email TEXT,
subject TEXT,
message_type TEXT,
template_id TEXT
)
Model definition