mirror of
https://github.com/getml/sqlgen.git
synced 2025-12-31 06:30:18 -06:00
sqlgen Documentation
Welcome to the sqlgen documentation. This guide provides detailed information about sqlgen's features and APIs.
Core Concepts
- Defining Tables - How to define tables using C++ structs
- sqlgen::Result - How sqlgen handles errors and results
- sqlgen::PrimaryKey - How to define primary keys in sqlgen
- sqlgen::Flatten - How to "inherit" fields from other structs
- sqlgen::to_sql - How to transpile C++ operations to dialect-specific SQL
Database Operations
-
sqlgen::read - How to read data from a database
-
sqlgen::write - How to write data to a database
-
sqlgen::create_index - How to create an index on a table
-
sqlgen::create_table - How to create a new table
-
sqlgen::delete_from - How to delete data from a table
-
sqlgen::drop - How to drop a table
-
sqlgen::insert - How to insert data within transactions
-
sqlgen::update - How to update data in a table
-
Transactions - How to use transactions for atomic operations
Data Types and Validation
- sqlgen::Timestamp - How timestamps work in sqlgen
- sqlgen::Varchar - How varchars work in sqlgen
- sqlgen::Pattern - How to add regex pattern validation to avoid SQL injection
Supported Databases
- PostgreSQL - How to interact with PostgreSQL and compatible databases (Redshift, Aurora, Greenplum)
- SQLite - How to interact with SQLite3
For installation instructions, quick start guide, and usage examples, please refer to the main README.