Google Calendar Database Schema
Database entities and querying synced Google Calendar data
The Google Calendar plugin automatically syncs data from Google Calendar to your database. This allows you to query calendar data without making API calls, providing faster access and offline capabilities.
New to Corsair? Learn about core concepts like database operations, data synchronization, and multi-tenancy before working with the database.
Full Implementation: For the complete, up-to-date database schema and implementations, see the Google Calendar plugin source code on GitHub.
Synced Entities
The Google Calendar plugin syncs the following entities to your database:
- events - Calendar events
- calendars - Calendar information
Database API
Access synced data through the db property:
const events = await corsair.googlecalendar.db.events.search({
data: { summary: "Meeting" },
});Events
Schema
{
id: string;
status?: 'confirmed' | 'tentative' | 'cancelled';
summary?: string;
description?: string;
location?: string;
start?: {
date?: string;
dateTime?: string;
timeZone?: string;
};
end?: {
date?: string;
dateTime?: string;
timeZone?: string;
};
attendees?: Array<{
email?: string;
displayName?: string;
responseStatus?: 'needsAction' | 'declined' | 'tentative' | 'accepted';
}>;
calendarId?: string;
createdAt?: Date;
}Querying Events
Search by summary:
const events = await corsair.googlecalendar.db.events.search({
data: { summary: "Meeting" },
});Search by calendar:
const events = await corsair.googlecalendar.db.events.search({
data: { calendarId: "primary" },
});Calendars
Schema
{
id: string;
summary?: string;
description?: string;
location?: string;
timeZone?: string;
createdAt?: Date;
}Querying Calendars
Search by summary:
const calendars = await corsair.googlecalendar.db.calendars.search({
data: { summary: "Work Calendar" },
});See Database for more information about database concepts and querying patterns.