Support for snake_case column names
See original GitHub issueHi,
the preferred naming convention for postgres databases calls for table/column names to be using snake_case, since Dapper allows reading such columns with Dapper.DefaultTypeMap.MatchNamesWithUnderscores <- true
could we also somehow add an option for names in record fields to be interpreted as snake_case
?
Example:
let r = {
Id = Guid.NewGuid()
FirstName = "Works"
LastName = "Great"
DateOfBirth = DateTime.Today
Position = 1
}
let sql, values =
insert {
table "person"
value r
} |> Deconstructor.insert
printfn "%s" sql
// INSERT INTO person (id, first_name, last_name, position, date_of_birth)
// VALUES (@Id0, @FirstName0, @LastName0, @Position0, @DateOfBirth0)"
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Convert dataframe column names from camel case to ...
Convert dataframe column names from camel case to snake case ... I want to change the column labels of a Pandas DataFrame from...
Read more >Using snake case column names with Dapper and ...
In this post I describe how to use snake case naming conventions when using Dapper, by using "Schema" utility classes, nameof(), ...
Read more >Format names and values — format_names • cleaner
This function can be used on any data.frame , list or character vector to format their names or values. It supports snake case...
Read more >Snake case
It is a commonly used naming convention in computing, for example for variable and subroutine names, and for filenames. One study has found...
Read more >Change jdbc column names to snake case as default. #2074
The request of this issue is to change the default table and column definitions from camelCase/PascalCase to snake case to make it more...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the offer, Michal, but I decided not to complicate the library. Custom mapping over column names is a rabbit hole in the long-term and I’ll keep trying to avoid it as long as possible.
I also thought it could be a nice indicator that such a record should never leave the context of data access. Anyways, if you decide against such a feature just close this issue, as I said, I can easily work around this. Of course if you decide for it I’d be happy to help with the implementation!