-- Fetch all the Messages belonging to the SendGrid
-- account of a particular user.
SELECT *
FROM fiber.sendgrid_message
WHERE account_id = '{user.sendgrid_id}'
-- Fetch all the Messages belonging to the SendGrid
-- account of a particular user.
SELECT *
FROM fiber.sendgrid_message
WHERE account_id = '{user.sendgrid_id}'
Code
CREATE TABLE fiber.sendgrid_message (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
from_email TEXT,
msg_id TEXT,
subject TEXT,
to_email TEXT,
status TEXT,
opens_count INT,
click_counts INT,
last_event_time TIMESTAMP WITH TIME ZONE
)
CREATE TABLE fiber.sendgrid_message (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
from_email TEXT,
msg_id TEXT,
subject TEXT,
to_email TEXT,
status TEXT,
opens_count INT,
click_counts INT,
last_event_time TIMESTAMP WITH TIME ZONE
)
Model definition