- Reverted generator dependency Glob from 1.2.0-alpha0037 to 1.2.0-alpha0032 due to issues
- Disabled F# 9 nullability warning (FS3261) in generated code
- Updated generator dependency FSharp.Core from 8.0.401 to 9.0.100
- Updated generator dependency Glob from 1.2.0-alpha0032 to 1.2.0-alpha0037
- Added table script
deleteBatch
- Can now generate
merge
table scripts for tables with only primary key columns (will then simply insert if the row does not exist) - Updated Microsoft.Data.SqlClient from 5.2.1 to 5.2.2
- Updated generator dependency Microsoft.SqlServer.TransactSql.ScriptDom from 161.9123.0 to 161.9142.1
- Updated generator dependency FSharp.Core from 8.0.301 to 8.0.401
- Now supports overriding column nullability for table DTOs, scripts, and procedures. This can be useful to circumvent
certain limitations of SQL Server's type inference for scripts and procedures. For example, if a computed column is
defined as
COALESCE(NullCol, NonNullCol)
, then the column in the table DTO may be correctly inferred to be non-null, while in scripts and procedures it may be nullable. To use this feature, use the new YAMLnullable
key in thecolumns
object of scripts, procedures, or table DTOs.
- Now targets .NET Standard 2.0 (generator still requires .NET 6+ installed at build-time)
- Updated Microsoft.Data.SqlClient from 5.1.4 to 5.2.1
- Updated FSharp.SystemTextJson from 1.2.42 to 1.3.13
- Updated generator dependency Microsoft.Extensions.Configuration.Binder from 8.0.1 to 8.0.2
- Updated generator dependency Microsoft.SqlServer.TransactSql.ScriptDom from 161.9109.0 to 161.9123.0
- Updated generator dependency FSharp.Core from 8.0.200 to 8.0.301
- Temp tables in Facil-generated
tableScripts
are now dropped if they exist before they are created. This allows using the same temp table name in multiple commands in the same connection. - Updated the readme with a note about having to do temp table dropping manually for your own scripts.
- Cancellations now throw
OperationCanceledException
instead ofSqlException
. This is a workaround for dotnet/SqlClient#26. Strictly speaking it is a breaking change, but only if you rely on cancellations specifically throwingSqlException
and notOperationCanceledException
. This seems far-fetched enough that I am bumping only the minor version for this change. The above does not apply to theLazyExecute*
methods returningIAsyncEnumerable<_>
.
- Added
Execute
methods for getting aSqlDataReader
. While less type safe, this makes it possible to use Facil scripts to fetch data for legacy code that loads domain objects usingSqlDataReader
(or from related types, such asDataTable
).
- Updated Microsoft.Data.SqlClient from 5.1.2 to 5.1.4
- Updated generator dependency Microsoft.Extensions.Configuration.Binder from 8.0.0 to 8.0.1
- Fixed source table column casing in
insertBatch
scripts
- Now automatically ignores
GENERATE ALWAYS
columns in insert/update/merge table scripts (e.g. in temporal tables) - Updated Microsoft.Data.SqlClient from 5.1.1 to 5.1.2
- Updated generator dependencies
- Updated Microsoft.Data.SqlClient from 5.1.0 to 5.1.1
- Updated generator dependencies
- Added table DTO option
mappingCtor
, which adds a constructor that accepts an object whose properties are a superset of the properties of the table DTO. This can be useful if you want to use the table DTO with a script that returns additional columns (for example representing the total number of rows, or an additional value to group by).
- Improve some error messages when generation fails due to invalid SQL
- Generator: Reverted Glob to 1.2.0-alpha0032 to avoid upstream bug
- Updated Microsoft.Data.SqlClient from 5.0.1 to 5.1.0
- Generator: Updated FSharp.SystemTextJson from 1.0.7 to 1.1.23
- Generator: Updated Microsoft.Extensions.Configuration.Binder from 7.0.1 to 7.0.2
- Generator: Updated Glob from 1.2.0-alpha0032 to 1.2.0-alpha0037
- Fixed missing primary key in temp table for
mergeBatch
table scripts
- Added batch insert/update/merge table scripts (
insertBatch
,updateBatch
, andmergeBatch
)
- Fixed a build-time error for certain queries when using connection strings with credentials but without
Persist Security Info=true
- Updated Microsoft.Data.SqlClient from 5.0.0 to 5.0.1
- Reverted some package changes in the generator to avoid an upstream bug
- Updated Microsoft.Data.SqlClient from 4.1.0 to 5.0.0
- Fixed rare bug where generation failed for stored procedures that used temp tables and required execution to infer the
result set (i.e., where neither
sp_describe_first_result_set
norSET FMTONLY ON
could be used) (#39)
- Now warns and ignores scripts with multiple columns where at least one is unnamed, instead of throwing NullReferenceException
- Fixed false negative config change detections (where regeneration was skipped even if the config was changed)
- Now warns when encountering non-existent columns in table scripts
- Fixed false negative table type compatibility result
- Fixed regression introduced in 2.4.0 where Facil would trigger regeneration in different environments even if there were no changes in the config
- Column order is now ignored when finding matching table types for table scripts
- Column order is now ignored when finding matching table DTOs for script output
- Fix compilation error when a script or procedure returns a table DTO whose name or schema is not a valid F# identifier
- If you generate multiple files (i.e., have multiple rulesets), when you modify the YAML file, Facil will now only regenerate the files corresponding to the changed rulesets
- You can now use
includeColumns
as syntactic sugar intableDto
configurations
- Reverted some package changes in the generator to avoid an upstream bug
- Fixed erroneous build-time warning
- Updated Microsoft.Data.SqlClient from 4.0.0 to 4.1.0
- Now supports temp tables for procedures (in addition to scripts)
- Table scripts may now use columns that are explicitly skipped in a table DTO for the same table
- Added an optional
SqlTransaction
parameter to theWithConnection
overload accepting aSqlConnection
. This is now the preferred method of setting a transaction, and may be required for future functionality (see e.g. below). The old one (usingConfigureCommand
) will continue to work, but an exception will be thrown if both methods are used. - Scripts using temp tables now work with transactions (requires using the new
WithConnection
overload to set the transaction)
- Fixed a regression in 2.1.1 where table scripts were missing if the table was not included in a table DTO rule
- Fixed a bug where generation would fail if the database contains a table that is not actually included, and the table has unsupported columns
- Generation now uses a rolled-back transaction when it needs to execute procedures and scripts, so that the database is not changed during build-time even if the script makes changes
- Added a
getAll
table script type that simply selects all rows from a table (SELECT Col1, Col2 FROM TableName
)
- Now targets only .NET 6 (both for build-time and run-time)
- Updated Microsoft.Data.SqlClient from 2.1.0 to 4.0.0. For details on which breaking changes this entails, see the package's 3.0.0 release notes and 4.0.0 release notes. Notably, connections are now encrypted by default.
- Fix build-time bug where scripts starting with a CTE (
WITH
) and having parameter types configured infacil.yaml
required a semicolon beforeWITH
to build properly. (The semicolon was required because configured parameter types causes Facil to insert parameter definitions at the start of the script during build. Facil now inserts the required semicolon automatically during this process.)
- Added
paramDto
config key to procedures and scripts, with valuesinline
(default),nominal
(generate a nominal input DTO type, similar to whatresult: nominal
does for output), andskip
(replacing the oldskipParamDto
). - Deprecated
skipParamDto
; useparamDto: skip
instead.
- Will now always skip computed columns in insert/update/merge table scripts
- Will now silently ignore insert/update/merge/delete table scripts for matched views
- Procedure parameters now support
nullable
overrides, just like script parameters
- Changed the output format of script source code to clean up and improve telemetry that picks up the script source ( specifically, modified the script source indentation and inserted the script name in a comment at the top of the script)
- Fixed table script merge (now merges based on the final name, not the template name with
{TableName}
and other tokens)
- Fixed build targets on Linux
- Added ability to generate
MERGE
table script (“upsert”) - Added
selectColumns
as syntactic sugar for output columns inGet*
table scripts
getByColumns
andgetByColumnsBatch
table scripts now require non-null parameters even if filtering on nullable columns
- Changed the new
getPrimaryKey
function from a module function to a static member on the table DTO type to avoid conflicts when there are table DTOs that only differ by one of them ending withModule
- Add a table DTO module alongside each table DTO containing a function to get the DTO’s primary key (if none of the PK columns are skipped)
- Added a public constructor to all script/procedure entry types to help reflection/SRTP (the constructor throws if called)
- Fix regression causing false negatives in check for whether a table DTO can be returned by a script/procedure
- Fix bug where table DTO could not be used as a result set if it was explicitly specified using
result
- Facil can now automatically generate the following simple per-table CRUD scripts, saving you from both writing and
configuring them:
- insert
- update
- delete
- get by primary key
- get batch by primary key
- get by a set of arbitrary columns
- get batch by a set of arbitrary columns
tableDtos
now includes views in addition to tables
- Improved error message when lacking permission to view the definition of a stored procedure.
- Adjust generated code to avoid stack overflow when there are very many (several hundreds) nullable output columns, due to particularities of the F# compiler (#9/#10, thanks @davidtme)
- Make the generated code more compatible with older F# versions
- Allow setting
result
tonominal
for procedures and scripts, which will generate and use a normal F# record for the result set.
- Made async computations for parametrized operations directly retryable ( see #6 for details)
- Fixed parameter and column inheritance
- Fixed bug where case-transformed table DTOs used as outputs used incorrect casing
- Breaking: Table DTO fields are now PascalCase so they can be easily used in DTO
WithParameter
overloads even when table columns are camelCase.
- Fixed exception when passing empty TVPs
- Automatically support dynamic SQL queries with full-text predicates (previously required
buildValue
) - Generally check more dynamic SQL by executing script with non-zero/non-empty parameter values
- Fixed bug where MAX length parameters in TVP would throw exception
- The default generated file module is now public instead of internal (since internal table DTOs can’t be used in the
DTO
WithParameter
overloads). - Fixed bug where table DTOs with non-F#-friendly column names would fail
- Make change detection more resilient against environment differences
- Fix false positive change detection from v0.1.9
- Ignore line endings when comparing script sources for determining whether to regenerate
- Facil will no longer regenerate if connection string variable contents change. This was fundamentally flawed, since it meant that if you don’t want to regenerate on CI, you’d have to set up a variable with the exact same connection string you use locally. Now you don’t have to set up any variables on CI if you don’t intend to regenerate.
- Fixed some edge cases with dynamic SQL
- Add
buildValue
parameter config to work around some dynamic SQL limitations
- Fixed parameter and column inheritance
- Fixed ignored columns in table DTOs
- Now parses only included stored procedures
- Fixed rare script parsing error
- Fixed script base path bug
- Support temp tables for scripts ( thanks @davidtme!) (#2, #3)
- Added ability to configure script base path
- Added ability to ignore columns in scripts, procedures, and table DTOs #4
- Added package logo
- Improved error message for scripts with undeclared parameters used in EXEC
- Initial release