From c69430c2c0403f5b6878adc25ca52f0b4ff9ca23 Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Wed, 24 Jan 2024 17:12:51 +0800 Subject: [PATCH] sqlite: decimal -> real --- src/sqlite/def/types.rs | 2 +- tests/live/sqlite/src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sqlite/def/types.rs b/src/sqlite/def/types.rs index f7313d5..7aa6576 100644 --- a/src/sqlite/def/types.rs +++ b/src/sqlite/def/types.rs @@ -28,7 +28,7 @@ pub fn parse_type(data_type: &str) -> Result { "bigint" => ColumnType::BigInteger, "float" => ColumnType::Float, "double" => ColumnType::Double, - "decimal_text" => ColumnType::Decimal(if parts.len() == 2 { + "real" => ColumnType::Decimal(if parts.len() == 2 { Some((parts[0], parts[1])) } else { None diff --git a/tests/live/sqlite/src/main.rs b/tests/live/sqlite/src/main.rs index a38b7c1..e75daca 100644 --- a/tests/live/sqlite/src/main.rs +++ b/tests/live/sqlite/src/main.rs @@ -283,7 +283,7 @@ async fn test_002() -> DiscoveryResult<()> { [ r#"CREATE TABLE "order" ("#, r#""id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,"#, - r#""total" decimal_text,"#, + r#""total" real,"#, r#""bakery_id" integer NOT NULL,"#, r#""customer_id" integer NOT NULL,"#, r#""placed_at" datetime_text NOT NULL DEFAULT CURRENT_TIMESTAMP,"#, @@ -298,7 +298,7 @@ async fn test_002() -> DiscoveryResult<()> { [ r#"CREATE TABLE "lineitem" ("#, r#""id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,"#, - r#""price" decimal_text,"#, + r#""price" real,"#, r#""quantity" integer,"#, r#""order_id" integer NOT NULL,"#, r#""cake_id" integer NOT NULL,"#,