Expand description
SQL code generator
§SQL Code Generation
This submodule provides essential constructors for SQL queries tailored to the operations performed within the Atmosphere framework. It includes functionalities for dynamically building queries for CRUD (Create, Read, Update, Delete) operations, and managing bindings between SQL queries and table entities.
§Key features:
-
Query Builders: Functions like
select,insert,update,delete, andupsert, which create SQL queries for their respective operations. These builders ensure that queries are correctly formatted and aligned with the structure and constraints of the target table. -
Binding Management: The
Bindingsstruct and its implementations, which manage the relationship between table columns and the SQL queries they are bound to. This ensures that queries are executed with the correct parameters and their values.
Structs§
- Bindings
- Struct representing bindings for SQL queries.
Functions§
- delete
- Generates a
DELETEquery to remove a row from the table based on its primary key. - delete_
by - Creates a
DELETEquery to remove rows from the table based on a specific column. - insert
- Generates an
INSERTquery to add a new row to the table. - select
- Generates a
SELECTquery to retrieve a single row from the table based on its primary key. - select_
all - Constructs a
SELECTquery to fetch all rows from the table. - select_
by - Creates a
SELECTquery to retrieve rows from the table based on a specific column. - update
- Creates an
UPDATEquery to modify an existing row in the table. - upsert
- Constructs an
UPSERTquery (update or insert) for a row in the table.