Skip to content

synv2 #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.6.42
- Fix `QueryBuilder` for Microsoft SQL Server: https://github.com/sqlpage/sqlx-oldapi/issues/11
- Add support for Microsoft SQL Server DateTime columns in sqlx macros: macros https://github.com/sqlpage/sqlx-oldapi/issues/16

## 0.6.41
- Upgrade rustls to 0.23
- Provide detailed error messages on TLS connection issues
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sqlx-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ url = { version = "2.2.2", default-features = false }

[dependencies.syn]
# This is basically default features plus "full" but if they add more defaults later then we don't need to enable those.
version = "1.0.109"
version = "2.0.101"
default-features = false
features = ["full", "parsing", "printing", "derive", "clone-impls", "proc-macro"]

Expand Down
6 changes: 1 addition & 5 deletions sqlx-macros/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ pub(crate) fn resolve_path(path: impl AsRef<Path>, err_span: Span) -> syn::Resul

// requires `proc_macro::SourceFile::path()` to be stable
// https://github.com/rust-lang/rust/issues/54725
if path.is_relative()
&& !path
.parent()
.map_or(false, |parent| !parent.as_os_str().is_empty())
{
if path.is_relative() && path.parent().is_none_or(|p| p.as_os_str().is_empty()) {
return Err(syn::Error::new(
err_span,
"paths relative to the current file's directory are not currently supported",
Expand Down
204 changes: 109 additions & 95 deletions sqlx-macros/src/derives/attributes.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use proc_macro2::{Ident, Span, TokenStream};
use quote::{quote, quote_spanned};
use syn::punctuated::Punctuated;
use syn::spanned::Spanned;

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, tokio, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, tokio, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, tokio, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, actix, native-tls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, tokio, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, tokio, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, rustls)

unused import: `syn::spanned::Spanned`

Check warning on line 4 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, rustls)

unused import: `syn::spanned::Spanned`
use syn::token::Comma;
use syn::{Attribute, DeriveInput, Field, Lit, Meta, MetaNameValue, NestedMeta, Variant};
use syn::{
Attribute, DeriveInput, Expr, Field, Lit, LitStr, Meta, MetaNameValue, Path, Token, Variant,

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, tokio, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, actix, native-tls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`

Check warning on line 7 in sqlx-macros/src/derives/attributes.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, rustls)

unused imports: `LitStr`, `MetaNameValue`, `Path`, and `Token`
};

macro_rules! assert_attribute {
($e:expr, $err:expr, $input:expr) => {
Expand Down Expand Up @@ -83,89 +85,94 @@

for attr in input
.iter()
.filter(|a| a.path.is_ident("sqlx") || a.path.is_ident("repr"))
.filter(|a| a.path().is_ident("sqlx") || a.path().is_ident("repr"))
{
let meta = attr
.parse_meta()
.map_err(|e| syn::Error::new_spanned(attr, e))?;
match meta {
match &attr.meta {
Meta::List(list) if list.path.is_ident("sqlx") => {
for value in list.nested.iter() {
match value {
NestedMeta::Meta(meta) => match meta {
Meta::Path(p) if p.is_ident("transparent") => {
try_set!(transparent, true, value)
let nested_metas =
list.parse_args_with(Punctuated::<Meta, syn::token::Comma>::parse_terminated)?;
for meta_item in nested_metas {
match meta_item {
Meta::Path(p) if p.is_ident("transparent") => {
try_set!(transparent, true, p)
}
Meta::NameValue(mnv) if mnv.path.is_ident("rename_all") => {
if let Expr::Lit(expr_lit) = &mnv.value {
if let Lit::Str(val_str) = &expr_lit.lit {
let val = match &*val_str.value() {
"lowercase" => RenameAll::LowerCase,
"snake_case" => RenameAll::SnakeCase,
"UPPERCASE" => RenameAll::UpperCase,
"SCREAMING_SNAKE_CASE" => RenameAll::ScreamingSnakeCase,
"kebab-case" => RenameAll::KebabCase,
"camelCase" => RenameAll::CamelCase,
"PascalCase" => RenameAll::PascalCase,
_ => fail!(val_str, "unexpected value for rename_all"),
};
try_set!(rename_all, val, &mnv.path)
} else {
fail!(expr_lit, "expected string literal for rename_all")
}
} else {
fail!(&mnv.value, "expected literal expression for rename_all")
}

Meta::NameValue(MetaNameValue {
path,
lit: Lit::Str(val),
..
}) if path.is_ident("rename_all") => {
let val = match &*val.value() {
"lowercase" => RenameAll::LowerCase,
"snake_case" => RenameAll::SnakeCase,
"UPPERCASE" => RenameAll::UpperCase,
"SCREAMING_SNAKE_CASE" => RenameAll::ScreamingSnakeCase,
"kebab-case" => RenameAll::KebabCase,
"camelCase" => RenameAll::CamelCase,
"PascalCase" => RenameAll::PascalCase,
_ => fail!(meta, "unexpected value for rename_all"),
};

try_set!(rename_all, val, value)
}
Meta::NameValue(mnv) if mnv.path.is_ident("type_name") => {
if let Expr::Lit(expr_lit) = &mnv.value {
if let Lit::Str(val_str) = &expr_lit.lit {
try_set!(
type_name,
TypeName {
val: val_str.value(),
span: val_str.span(),
deprecated_rename: false
},
&mnv.path
)
} else {
fail!(expr_lit, "expected string literal for type_name")
}
} else {
fail!(&mnv.value, "expected literal expression for type_name")
}

Meta::NameValue(MetaNameValue {
path,
lit: Lit::Str(val),
..
}) if path.is_ident("type_name") => {
try_set!(
type_name,
TypeName {
val: val.value(),
span: value.span(),
deprecated_rename: false
},
value
)
}
Meta::NameValue(mnv) if mnv.path.is_ident("rename") => {
if let Expr::Lit(expr_lit) = &mnv.value {
if let Lit::Str(val_str) = &expr_lit.lit {
try_set!(
type_name,
TypeName {
val: val_str.value(),
span: val_str.span(),
deprecated_rename: true
},
&mnv.path
)
} else {
fail!(expr_lit, "expected string literal for rename")
}
} else {
fail!(&mnv.value, "expected literal expression for rename")
}

Meta::NameValue(MetaNameValue {
path,
lit: Lit::Str(val),
..
}) if path.is_ident("rename") => {
try_set!(
type_name,
TypeName {
val: val.value(),
span: value.span(),
deprecated_rename: true
},
value
)
}

u => fail!(u, "unexpected attribute"),
},
u => fail!(u, "unexpected attribute"),
}
u => fail!(u, "unexpected attribute inside sqlx(...)"),
}
}
}
Meta::List(list) if list.path.is_ident("repr") => {
if list.nested.len() != 1 {
fail!(&list.nested, "expected one value")
let nested_metas =
list.parse_args_with(Punctuated::<Meta, syn::token::Comma>::parse_terminated)?;
if nested_metas.len() != 1 {
fail!(&list.path, "expected one value for repr")
}
match list.nested.first().unwrap() {
NestedMeta::Meta(Meta::Path(p)) if p.get_ident().is_some() => {
try_set!(repr, p.get_ident().unwrap().clone(), list);
match nested_metas.first().unwrap() {
Meta::Path(p) if p.get_ident().is_some() => {
try_set!(repr, p.get_ident().unwrap().clone(), &list.path);
}
u => fail!(u, "unexpected value"),
u => fail!(u, "unexpected value for repr"),
}
}
_ => {}
_ => { /* Not an attribute we are interested in, or not a list */ }
}
}

Expand All @@ -183,30 +190,37 @@
let mut try_from = None;
let mut flatten = false;

for attr in input.iter().filter(|a| a.path.is_ident("sqlx")) {
let meta = attr
.parse_meta()
.map_err(|e| syn::Error::new_spanned(attr, e))?;

if let Meta::List(list) = meta {
for value in list.nested.iter() {
match value {
NestedMeta::Meta(meta) => match meta {
Meta::NameValue(MetaNameValue {
path,
lit: Lit::Str(val),
..
}) if path.is_ident("rename") => try_set!(rename, val.value(), value),
Meta::NameValue(MetaNameValue {
path,
lit: Lit::Str(val),
..
}) if path.is_ident("try_from") => try_set!(try_from, val.parse()?, value),
Meta::Path(path) if path.is_ident("default") => default = true,
Meta::Path(path) if path.is_ident("flatten") => flatten = true,
u => fail!(u, "unexpected attribute"),
},
u => fail!(u, "unexpected attribute"),
for attr in input.iter().filter(|a| a.path().is_ident("sqlx")) {
if let Meta::List(list) = &attr.meta {
let nested_metas =
list.parse_args_with(Punctuated::<Meta, syn::token::Comma>::parse_terminated)?;
for meta_item in nested_metas {
match meta_item {
Meta::NameValue(mnv) if mnv.path.is_ident("rename") => {
if let Expr::Lit(expr_lit) = &mnv.value {
if let Lit::Str(val_str) = &expr_lit.lit {
try_set!(rename, val_str.value(), &mnv.path)
} else {
fail!(expr_lit, "expected string literal for rename")
}
} else {
fail!(&mnv.value, "expected literal expression for rename")
}
}
Meta::NameValue(mnv) if mnv.path.is_ident("try_from") => {
if let Expr::Lit(expr_lit) = &mnv.value {
if let Lit::Str(val_str) = &expr_lit.lit {
try_set!(try_from, val_str.parse()?, &mnv.path)
} else {
fail!(expr_lit, "expected string literal for try_from")
}
} else {
fail!(&mnv.value, "expected literal expression for try_from")
}
}
Meta::Path(path) if path.is_ident("default") => default = true,
Meta::Path(path) if path.is_ident("flatten") => flatten = true,
u => fail!(u, "unexpected attribute inside sqlx(...)"),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions sqlx-macros/src/derives/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use syn::punctuated::Punctuated;
use syn::token::Comma;
use syn::{
parse_quote, Data, DataEnum, DataStruct, DeriveInput, Expr, Field, Fields, FieldsNamed,
FieldsUnnamed, Lifetime, LifetimeDef, Stmt, Variant,
FieldsUnnamed, Lifetime, LifetimeParam, Stmt, Variant,
};

pub fn expand_derive_encode(input: &DeriveInput) -> syn::Result<TokenStream> {
Expand Down Expand Up @@ -66,7 +66,7 @@ fn expand_derive_encode_transparent(
let mut generics = generics.clone();
generics
.params
.insert(0, LifetimeDef::new(lifetime.clone()).into());
.insert(0, LifetimeParam::new(lifetime.clone()).into());

generics
.params
Expand Down
38 changes: 23 additions & 15 deletions sqlx-macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::large_enum_variant)]
#![cfg_attr(
not(any(feature = "postgres", feature = "mysql", feature = "offline")),
allow(dead_code, unused_macros, unused_imports)
Expand All @@ -12,6 +13,10 @@

use quote::quote;

use syn::parse::{Parse, ParseStream};
use syn::punctuated::Punctuated;
use syn::{parse_macro_input, DeriveInput, ItemFn, LitStr, Meta, Token};

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, async-std, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (10, actix, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (5_7, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MySQL (8, async-std, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_6, tokio, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, actix, native-tls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / MariaDB (10_3, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

Check warning on line 18 in sqlx-macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / Postgres (14, tokio, rustls)

unused imports: `DeriveInput` and `LitStr`

type Error = Box<dyn std::error::Error>;

type Result<T> = std::result::Result<T, Error>;
Expand All @@ -27,6 +32,16 @@
#[cfg(feature = "migrate")]
mod migrate;

struct ArgsParser(Punctuated<Meta, Token![,]>);

impl Parse for ArgsParser {
fn parse(input: ParseStream) -> syn::Result<Self> {
Ok(ArgsParser(Punctuated::<Meta, Token![,]>::parse_terminated(
input,
)?))
}
}

#[proc_macro]
pub fn expand_query(input: TokenStream) -> TokenStream {
let input = syn::parse_macro_input!(input as query::QueryMacroInput);
Expand Down Expand Up @@ -101,19 +116,12 @@
}

#[proc_macro_attribute]
pub fn test(args: TokenStream, input: TokenStream) -> TokenStream {
let args = syn::parse_macro_input!(args as syn::AttributeArgs);
let input = syn::parse_macro_input!(input as syn::ItemFn);

match test_attr::expand(args, input) {
Ok(ts) => ts.into(),
Err(e) => {
if let Some(parse_err) = e.downcast_ref::<syn::Error>() {
parse_err.to_compile_error().into()
} else {
let msg = e.to_string();
quote!(::std::compile_error!(#msg)).into()
}
}
}
pub fn test(
args: proc_macro::TokenStream,
input: proc_macro::TokenStream,
) -> proc_macro::TokenStream {
let args = parse_macro_input!(args as ArgsParser).0;
let input = parse_macro_input!(input as ItemFn);

test_attr::expand(args, input)
}
4 changes: 2 additions & 2 deletions sqlx-macros/src/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl ToTokens for QuotedMigrationType {
quote! { ::sqlx_oldapi::migrate::MigrationType::ReversibleDown }
}
};
tokens.append_all(ts.into_iter());
tokens.append_all(ts);
}
}

Expand Down Expand Up @@ -101,7 +101,7 @@ pub(crate) fn expand_migrator(path: &Path) -> crate::Result<TokenStream> {
.replace('_', " ")
.to_owned();

let sql = fs::read_to_string(&entry.path())?;
let sql = fs::read_to_string(entry.path())?;

let checksum = Vec::from(Sha384::digest(sql.as_bytes()).as_slice());

Expand Down
Loading
Loading