Columns with similar names on the DB collide in SQLProvider
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
Research direction
Start by reproducing the collision in SQLProvider against SQL Server 2012 using columns named ExampleColumn, ExampleColumn:, and ExampleColumn_. Trace how the provider maps those database columns to F# identifiers. Done means the table can be queried without indistinct generated names, while preserving a usable way to reference every column.
Written by the indexing model from the issue text.
Description
Description
When a table has 2 or more columns whose names are only different by "special" characters, SQLProvider creates indistinct mappings for them.
Repro steps
- Create a table with these columns
- [ExampleColumn]
- [ExampleColumn:]
- [ExampleColumn_]
- Try to query this table from SQLProvider
Expected behavior
I would expect, given F#'s ability to create identifiers with special characters, that SQLProvider wouldn't need to alter your column names in any way (at least, as an option when creating the provider).
Actual behavior
SQLProvider will rename these fields with indistinct names, causing an exception to be thrown, and the table becomes un-queryable.
Known workarounds
Create a view in your database that disambiguates that column names and use that from SQLProvider, but this is not acceptable since you're then designing the database around an arbitrary tool in a separate code stack.
Related information
- SQL Server 2012
- Windows 7, SP1
- v1.1.30-1.1.58
- .NET 4.6
- Dominant language
- F#
- Stars
- 627
- Forks
- 147
- Avg merge
- 2h 2m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fsprojects/SQLProvider
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 55/100
fsprojects/SQLProvider#872 · 2 comments ·
-
Repo Assist? Openenhancement
Difficulty 5/5 Over a week Newbie friendliness 10/100
fsprojects/SQLProvider#870 · 1 comment ·
-
postgresql
Difficulty 4/5 3-5 days Newbie friendliness 58/100
fsprojects/SQLProvider#869 · 2 comments ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
fsprojects/SQLProvider#868 · 2 comments ·
-
sql server
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fsprojects/SQLProvider#851 · 1 comment ·