The delete procedural macro transforms an SQL DELETE query with named parameters into
an asynchronous function that interacts with the database. It provides various
features, including debugging options and support for returning the number of affected rows
or no return value (void).
The insert procedural macro transforms an SQL INSERT query with named parameters into
an asynchronous function that interacts with the database. It provides various
features, including debugging options and support for returning the number of affected rows
or no return value (void).
The multi_query procedural macro transforms a series of SQL queries with named parameters into
an asynchronous function that interacts with the database. It provides various
features, including debugging options, and is designed to handle multiple SQL statements with no return value (void).
The query procedural macro transforms an SQL query with named parameters into
an asynchronous function that interacts with the database. It provides various
features, including debugging options and support for multiple return types.
The select procedural macro transforms a SQL query with named parameters into
an asynchronous function that interacts with the database. It provides various
features, including debugging options and support for multiple return types.
tp_gen is a procedural macro attribute that provides advanced code generation capabilities
for database operations. This macro allows for more complex and customizable generation
of database-related functions beyond what the derive macros provide.
The update procedural macro transforms an SQL UPDATE query with named parameters into
an asynchronous function that interacts with the database. It provides various
features, including debugging options and support for returning the number of affected rows.
AnyTemplate is a database-agnostic version of SqlxTemplate that generates
database operations compatible with multiple database types. This macro generates
functions that work across different databases by using the most common SQL syntax.
Columns is a derive macro that generates column name constants and utility functions
for database operations. This macro creates static string constants for each field
in the struct, making it easier to reference column names in queries.
DDLTemplate is a derive macro that generates Data Definition Language (DDL) statements
for creating database tables based on the struct definition. This macro analyzes the struct
fields and their types to generate appropriate CREATE TABLE statements.
DeleteTemplate is a derive macro designed to automatically generate record deletion functions
based on sqlx. This macro creates delete methods for the struct it is applied to, returning
the number of records deleted.
It assumes that the columns in the database correspond to the fields in the struct.
InsertTemplate is a derive macro designed to automatically generate record insert functions
based on sqlx. This macro creates insert methods for the struct it is applied to, returning
the number of new records added. It assumes that the columns in the database correspond to the fields in the struct.
MysqlTemplate is a database-specific version of SqlxTemplate optimized for MySQL.
This macro generates all database operation functions specifically targeting MySQL features
and syntax. It combines insert, update, select, delete, and upsert operations with MySQL-specific
optimizations and syntax compatibility.
PostgresTemplate is a database-specific version of SqlxTemplate optimized for PostgreSQL.
This macro generates all database operation functions specifically targeting PostgreSQL features
and syntax. It combines insert, update, select, delete, and upsert operations with PostgreSQL-specific
optimizations and features like RETURNING clauses.
SelectTemplate is a derive macro designed to automatically generate record retrieval functions
based on sqlx. This macro creates various query methods for the struct it is applied to,
returning records from the database, assuming that the columns in the database correspond to the fields in the struct.
SqliteTemplate is a database-specific version of SqlxTemplate optimized for SQLite.
This macro generates all database operation functions specifically targeting SQLite features
and syntax. It combines insert, update, select, delete, and upsert operations with SQLite-specific
optimizations and syntax compatibility.
SqlxTemplate is a comprehensive derive macro that combines all database operation templates
into a single macro. This macro generates functions for insert, update, select, delete, and upsert
operations based on sqlx. It’s a convenience macro that applies InsertTemplate, UpdateTemplate,
SelectTemplate, DeleteTemplate, UpsertTemplate, and TableName all at once.
UpdateTemplate is a derive macro designed to automatically generate record update functions
based on sqlx. This macro creates update methods for the struct it is applied to, reducing
repetitive code and improving the readability and maintainability of your code.
It assumes that the columns in the database correspond to the fields in the struct.
UpsertTemplate is a derive macro designed to automatically generate upsert (INSERT … ON CONFLICT)
functions based on sqlx. This macro creates upsert methods for the struct it is applied to,
which can either insert a new record or update an existing one based on conflict resolution.
It assumes that the columns in the database correspond to the fields in the struct.