-- Fetch all the Accounts belonging to the Salesforce
-- account of a particular user.
SELECT *
FROM fiber.salesforce_account
WHERE account_id = '{user.salesforce_id}'
-- Fetch all the Accounts belonging to the Salesforce
-- account of a particular user.
SELECT *
FROM fiber.salesforce_account
WHERE account_id = '{user.salesforce_id}'
Code
CREATE TABLE fiber.salesforce_account (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
id TEXT,
is_deleted BOOLEAN,
master_record_id TEXT,
name TEXT,
type TEXT,
parent_id TEXT,
billing_street TEXT,
billing_city TEXT,
billing_state TEXT,
billing_postal_code TEXT,
billing_country TEXT,
billing_latitude DOUBLE PRECISION,
billing_longitude DOUBLE PRECISION,
billing_geocode_accuracy TEXT,
billing_address JSONB,
shipping_street TEXT,
shipping_city TEXT,
shipping_state TEXT,
shipping_postal_code TEXT,
shipping_country TEXT,
shipping_latitude DOUBLE PRECISION,
shipping_longitude DOUBLE PRECISION,
shipping_geocode_accuracy TEXT,
shipping_address JSONB,
phone TEXT,
fax TEXT,
website TEXT,
photo_url TEXT,
industry TEXT,
annual_revenue TEXT,
number_of_employees INT,
description TEXT,
owner_id TEXT,
created_date TIMESTAMP WITH TIME ZONE,
created_by_id TEXT,
last_modified_date TIMESTAMP WITH TIME ZONE,
last_modified_by_id TEXT,
system_modstamp TIMESTAMP WITH TIME ZONE,
last_activity_date TEXT,
last_viewed_date TIMESTAMP WITH TIME ZONE,
last_referenced_date TIMESTAMP WITH TIME ZONE,
is_partner BOOLEAN,
is_customer_portal BOOLEAN,
jigsaw TEXT,
jigsaw_company_id TEXT,
account_source TEXT,
sic_desc TEXT,
person_action_cadence_id TEXT,
person_action_cadence_assignee_id TEXT,
person_action_cadence_state TEXT,
is_buyer BOOLEAN,
activity_metric_id TEXT,
activity_metric_rollup_id TEXT
)
CREATE TABLE fiber.salesforce_account (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
id TEXT,
is_deleted BOOLEAN,
master_record_id TEXT,
name TEXT,
type TEXT,
parent_id TEXT,
billing_street TEXT,
billing_city TEXT,
billing_state TEXT,
billing_postal_code TEXT,
billing_country TEXT,
billing_latitude DOUBLE PRECISION,
billing_longitude DOUBLE PRECISION,
billing_geocode_accuracy TEXT,
billing_address JSONB,
shipping_street TEXT,
shipping_city TEXT,
shipping_state TEXT,
shipping_postal_code TEXT,
shipping_country TEXT,
shipping_latitude DOUBLE PRECISION,
shipping_longitude DOUBLE PRECISION,
shipping_geocode_accuracy TEXT,
shipping_address JSONB,
phone TEXT,
fax TEXT,
website TEXT,
photo_url TEXT,
industry TEXT,
annual_revenue TEXT,
number_of_employees INT,
description TEXT,
owner_id TEXT,
created_date TIMESTAMP WITH TIME ZONE,
created_by_id TEXT,
last_modified_date TIMESTAMP WITH TIME ZONE,
last_modified_by_id TEXT,
system_modstamp TIMESTAMP WITH TIME ZONE,
last_activity_date TEXT,
last_viewed_date TIMESTAMP WITH TIME ZONE,
last_referenced_date TIMESTAMP WITH TIME ZONE,
is_partner BOOLEAN,
is_customer_portal BOOLEAN,
jigsaw TEXT,
jigsaw_company_id TEXT,
account_source TEXT,
sic_desc TEXT,
person_action_cadence_id TEXT,
person_action_cadence_assignee_id TEXT,
person_action_cadence_state TEXT,
is_buyer BOOLEAN,
activity_metric_id TEXT,
activity_metric_rollup_id TEXT
)
Model definition