Introduction to ServiceSQL
ServiceSQL is a complete ORM (Object-Relational Mapping) library for Google Apps Script, inspired by Laravel’s Eloquent. It transforms your Google Sheets into a full-featured relational database with Models, Relationships, fluent QueryBuilder, powerful Collections, and much more.What is ServiceSQL?
ServiceSQL bridges the gap between Google Sheets and traditional database systems by providing:- Eloquent-style Models - Define your data structure with powerful model classes
- Fluent Query Builder - Write expressive database queries using a chainable API
- Relationships - Define and query complex data relationships (BelongsTo, HasMany, HasOne, ManyToMany)
- Collections - Transform and manipulate query results with 50+ utility methods
- Eager Loading - Efficiently load related data and avoid N+1 query problems
ServiceSQL works exclusively with Google Apps Script and Google Sheets. It’s perfect for building lightweight applications, data management tools, and automation scripts without requiring external database infrastructure.
Why Use ServiceSQL?
No Infrastructure Required
Use Google Sheets as your database - no need to manage servers, connections, or hosting costs.
Familiar Syntax
If you’ve used Laravel or similar ORMs, you’ll feel right at home with ServiceSQL’s API.
Powerful Relationships
Define complex relationships between your data and load them efficiently with eager loading.
Rich Collections
Transform, filter, and manipulate your data with a comprehensive collection of utility methods.
Key Features
Eloquent Models
Define your data models with static properties and lifecycle hooks:Fluent QueryBuilder
Build complex queries with an expressive, chainable API:Rich Relationships
Define and query relationships between your models:Powerful Collections
Manipulate query results with a rich set of collection methods:How It Works
ServiceSQL uses Google Sheets as the storage layer:- Each Sheet = One Table - Every sheet in your spreadsheet represents a database table
- First Row = Headers - Column names are defined in the first row of each sheet
- Data Rows = Records - Each subsequent row represents a single record
- SheetDriver - A driver layer translates ORM operations into sheet operations
Use Cases
ServiceSQL is ideal for:- Internal Tools - Build custom dashboards and admin panels
- Data Management - Create CRUD interfaces for team data
- Automation - Process and transform data with scheduled scripts
- Prototypes - Quickly build MVPs without database setup
- CRM Systems - Manage customer data and relationships
- Content Management - Store and organize content with relationships
Architecture Overview
ServiceSQL is built with a modular architecture:What’s Next?
Quickstart
Get a working example running in 5 minutes
Installation
Detailed setup instructions for your project