Skip to content

Commit 363581a

Browse files
committed
update to kurtbuilds_sql
1 parent 4aca027 commit 363581a

File tree

26 files changed

+80
-73
lines changed

26 files changed

+80
-73
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ futures = "0.3.31"
88
indexmap = { version = "2.7.0", features = ["serde"] }
99
proc-macro2 = "1.0.92"
1010
serde = { version = "1.0.217", features = ["derive"] }
11-
sqlmo = "0.24"
12-
sqlmo_sqlx = "0.24"
11+
kurtbuilds_sql = "0.26"
12+
kurtbuilds_sql_sqlx = "0.26"
1313
sqlx = "0.8.2"
1414
sqlx-core = "0.8.2"
1515
syn = { version = "2.0.94", features = ["full"] }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ async fn query_builder_example() {
324324
### Raw Query
325325

326326
You can fall back to raw queries if the ORM methods don't work for you. You can include handwritten strings, or if
327-
you want a lower-level query builder, you can use [`sqlmo`](https://github.com/kurtbuilds/sqlmo),
327+
you want a lower-level query builder, you can use [`sql`](https://github.com/kurtbuilds/sql),
328328
the underlying engine that powers `ormlite`'s query builder & migration auto-generation.
329329

330330
```rust

attr/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ structmeta = "0.3.0"
2222
convert_case.workspace = true
2323
anyhow.workspace = true
2424
ignore = "0.4"
25-
sqlmo.workspace = true
25+
kurtbuilds_sql.workspace = true
2626
tracing = "0.1"
2727
sqlformat = "=0.2.6"
2828

attr/src/ext.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use syn::{Data, DataStruct, DeriveInput, Field, Fields, FieldsNamed};
22

33
pub trait DeriveInputExt {
4-
fn fields(&self) -> syn::punctuated::Iter<Field>;
4+
fn fields(&self) -> syn::punctuated::Iter<'_, Field>;
55
}
66

77
impl DeriveInputExt for DeriveInput {
8-
fn fields(&self) -> syn::punctuated::Iter<Field> {
8+
fn fields(&self) -> syn::punctuated::Iter<'_, Field> {
99
let fields = match &self.data {
1010
Data::Struct(DataStruct { ref fields, .. }) => fields,
1111
_ => panic!("#[ormlite] can only be used on structs"),

attr/src/metadata/table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl TableMeta {
3434
.map(|c| c.clone())
3535
.map(|c| c.name.clone());
3636
if pkey.is_none() {
37-
let candidates = sqlmo::util::pkey_column_names(&name);
37+
let candidates = sql::util::pkey_column_names(&name);
3838
if let Some(c) = columns.iter_mut().find(|c| candidates.iter().any(|n| c.ident == n)) {
3939
c.has_database_default = true;
4040
pkey = Some(c.name.clone());

cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ ormlite.workspace = true
3030
ormlite-core.workspace = true
3131
ormlite-attr.workspace = true
3232
tokio = { version = "1", features = ["full"] }
33-
sqlmo.workspace = true
34-
sqlmo_sqlx.workspace = true
33+
kurtbuilds_sql.workspace = true
34+
kurtbuilds_sql_sqlx.workspace = true
3535
syn = "2"
3636
proc-macro2 = "1"
3737
url = "2"

cli/src/command/info.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use clap::Parser;
55
use ormlite::postgres::PgConnection;
66
use ormlite::{Acquire, Connection};
77
use ormlite_core::config::{get_var_database_url, get_var_model_folders};
8-
use sqlmo::Schema;
9-
use sqlmo_sqlx::FromPostgres;
8+
use sql::Schema;
9+
use sql_sqlx::FromPostgres;
1010

1111
#[derive(Parser, Debug)]
1212
pub struct Info {

cli/src/command/migrate.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use std::path::Path;
55

66
use anyhow::{anyhow, Context, Error, Result};
77
use clap::Parser;
8-
use sqlmo::{migrate::Statement, Dialect, Migration, Schema, ToSql};
9-
use sqlmo_sqlx::FromPostgres;
8+
use sql::{migrate::Statement, Dialect, Migration, Schema, ToSql};
9+
use sql_sqlx::FromPostgres;
1010
use time::macros::format_description;
1111
use time::OffsetDateTime as DateTime;
1212
use tokio::runtime::Runtime;
@@ -184,14 +184,20 @@ fn check_reversible_compatibility(reversible: bool, migration_environment: Optio
184184
#[allow(unused_variables)]
185185
fn experimental_modifications_to_schema(schema: &mut Schema) -> Result<()> {
186186
#[allow(unused_imports)]
187-
use sqlmo::Type;
187+
use sql::Type;
188188
for table in &mut schema.tables {
189189
for column in &mut table.columns {
190190
#[cfg(feature = "experimental-sid")]
191191
match &column.typ {
192192
Type::Other(z) if z == "Sid" => {
193193
column.typ = Type::Uuid;
194194
}
195+
Type::Other(z) if z == "Id" => {
196+
column.typ = Type::Uuid;
197+
}
198+
Type::Other(z) if z == "Timestamp" => {
199+
column.typ = Type::Timestamp;
200+
}
195201
_ => {}
196202
}
197203
}
@@ -214,7 +220,7 @@ fn autogenerate_migration(
214220

215221
let migration = current.migrate_to(
216222
desired,
217-
&sqlmo::MigrationOptions {
223+
&sql::MigrationOptions {
218224
debug: opts.verbose,
219225
allow_destructive: false,
220226
},

cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn main() -> Result<()> {
4444
tracing_subscriber::filter::Targets::new()
4545
.with_target(env!("CARGO_BIN_NAME"), level)
4646
.with_target("ormlite_attr", level)
47-
.with_target("sqlmo", level),
47+
.with_target("sql", level),
4848
)
4949
.init();
5050
use Command::*;

cli/src/schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::collections::HashMap;
22
use std::path::Path;
3-
use sqlmo::{Constraint, Schema, Table};
3+
use sql::{Constraint, Schema, Table};
44
use ormlite_attr::{schema_from_filepaths, Ident, InnerType, Type};
55
use ormlite_core::schema::FromMeta;
66
use anyhow::Result as AnyResult;

0 commit comments

Comments
 (0)