Module sql

Module sql 

Source
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, and upsert, 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 Bindings struct 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 DELETE query to remove a row from the table based on its primary key.
delete_by
Creates a DELETE query to remove rows from the table based on a specific column.
insert
Generates an INSERT query to add a new row to the table.
select
Generates a SELECT query to retrieve a single row from the table based on its primary key.
select_all
Constructs a SELECT query to fetch all rows from the table.
select_by
Creates a SELECT query to retrieve rows from the table based on a specific column.
update
Creates an UPDATE query to modify an existing row in the table.
upsert
Constructs an UPSERT query (update or insert) for a row in the table.