diff --git a/CHANGELOG.md b/CHANGELOG.md index ffee7f6..48c1124 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ 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.0.19] - 2024-06-28 + +Fixed: + +- fixed `selectAll` function generation: snake_case to camelCase is now being applied + ## [0.0.18] - 2024-06-28 Added: diff --git a/Cli/Cli.fsproj b/Cli/Cli.fsproj index 3bd7227..7aba25a 100644 --- a/Cli/Cli.fsproj +++ b/Cli/Cli.fsproj @@ -1,7 +1,7 @@  - 0.0.18 + 0.0.19 Exe net8.0 major diff --git a/Lib/FsGeneration/QueryModule.fs b/Lib/FsGeneration/QueryModule.fs index b0f62ea..22a851f 100644 --- a/Lib/FsGeneration/QueryModule.fs +++ b/Lib/FsGeneration/QueryModule.fs @@ -53,7 +53,7 @@ let relationToFsRecord (r: Relation) = Record(pascalCase r.name) { yield! fields } -let relationToSelect (r: Relation) = +let relationToSelectAll (r: Relation) = let cols = r.columns |> Seq.map fst |> String.concat ", " let selectQuery = $"SELECT {cols} FROM {r.name}" @@ -61,9 +61,9 @@ let relationToSelect (r: Relation) = r.columns |> List.mapi (fun i (c, t) -> match t with - | SqlInteger -> RecordFieldExpr(c, $"rd.GetInt32 {i}") - | SqlText -> RecordFieldExpr(c, $"rd.GetString {i}") - | SqlReal -> RecordFieldExpr(c, $"rd.GetDouble {i}")) + | SqlInteger -> RecordFieldExpr(camelCase c, $"rd.GetInt32 {i}") + | SqlText -> RecordFieldExpr(camelCase c, $"rd.GetString {i}") + | SqlReal -> RecordFieldExpr(camelCase c, $"rd.GetDouble {i}")) |> RecordExpr let whileBody = @@ -93,7 +93,7 @@ let queryModule (rs: Relation list) = for x in rs |> List.map relationToFsRecord do yield x - for x in rs |> List.map relationToSelect do + for x in rs |> List.map relationToSelectAll do yield x } } diff --git a/Lib/Lib.fsproj b/Lib/Lib.fsproj index 5536b9d..95f4f0b 100644 --- a/Lib/Lib.fsproj +++ b/Lib/Lib.fsproj @@ -4,7 +4,7 @@ net8.0 true MigrateLib - 0.0.18 + 0.0.19 Luis Ángel Méndez Gort Apache-2.0 Migrate