question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Column name mapping function

See original GitHub issue

Hi,

I want to be able to specify a function that maps column names everywhere (e.g. map to underscore/snake_case). I don’t want to manually specify it in each attribute nor auto-generate it via template.

I searched through the wiki/issues/code but couldn’t find an answer; any help is appreciated. Thank you.

Example:

MappingSchema.Default.ColumnNameResolver = columnName => columnName.ToSnakeCase();

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
jogibear9988commented, Apr 6, 2018
1reaction
MaceWinducommented, Feb 5, 2019

Ok, you were right. It will not be called if configured like that. See #1592. For now you need to attach callback in your DbContext constructor https://github.com/jsheely/linq2db-column-mapping-example/blob/master/Components/Database/DbContext.cs#L13 to this.MappingSchema instance

Read more comments on GitHub >

github_iconTop Results From Across the Web

r - Mantain column names in map function with table
I suppose you could pass in the column names of your data.frame using map2 . Then you could include dnn argument for table...
Read more >
Column Maps
A Column Map provides specifications needed to direct data from source columns to destination columns, match pairs of columns from separate tables for...
Read more >
Mapping Table Columns — SQLAlchemy 1.4 Documentation
A mapping by default shares the same name for a Column as that of the mapped attribute - specifically it matches the Column.key...
Read more >
Passing in column name as a function parameter into map ...
I'm new to packages like purrr and rlang. I'm trying to write a function that takes a dataset, a column name to group...
Read more >
Using column patterns in mapping data flow - Azure
Several mapping data flow transformations allow you to reference template columns based on patterns instead of hard-coded column names.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found