Table name not protected against spaces
See original GitHub issueRead and complete the full issue template
Do not randomly delete sections. They are here for a reason.
Do you want to request a feature or report a bug?
- Bug
- Feature
- Question
Did you test against the latest CI build?
- Yes
- No
If you answered No
, please test with the latest development build first.
Version of ClosedXML
0.97.0
What is the current behavior?
Allows empty space in table names
What is the expected behavior or new feature?
When you give a name to a table the code protect against starting with number or repeated names, but don’t protected against space The expected behavior is to give an error
Is this a regression from the previous version?
I don’t know is my first attempt to use the library
Issue Analytics
- State:
- Created 9 months ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Worst Practice - Spaces in Object Names
We should "never" put spaces in object names, whether those objects are tables or fields. One reason is this 'Object Name' (one space)...
Read more >sql - Pros and Cons of table name having spaces
Spaces in the tables names on the other hand add no value whatsoever. Mr. Anderson points out that its tedious. This is true...
Read more >Anyone ever see SQL with spaces in the table names?
This has been well covered but here's a summary: Yes, we have seen SQL with space in table names. No, this is NOT...
Read more >How to write SQL queries with spaces in column names
In this article, we are going to learn how we can write a SQL query with space in the column name. Blanks spaces...
Read more >The space between the table and its caption is very small
if the captions are placed in the "opposite" position (below tables or above figures), no intervening space is provided. so identifying the ...
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
@NickNack2020
I think it would be better to reject invalid name with an exception. Name of a table is not just an identifier, but it can also be used formulas structured references (e.g.
SUM(SalesTable[Profit])
).I am in favour of simple, understandable interfaces and contracts and principle of least surprise. Having a name sanitizer inside is not in line with that.
I would therefore refuse any invalid table names. We already throw an exception
There is already a table names 'Xyz'
when if someone tries to add a table with duplicate name. This only enhances the contract to be correct.Please add a note/mitigation about change to the https://github.com/ClosedXML/ClosedXML/blob/develop/docs/migrations/migrate-to-0.101.rst + info in XML doc.
Spec says
In the scenario that I was using was important that the name is correct. External System —> table names with spaces ----> closedXML Changing table names inside closedXML is a very dangerous solution in my opinion… The probability to think in every scenarios that the bad name (with spaces) can be used in the code can be huge…
I think the throwing error is the most correct. Is important the code has a coherent answer to dev errors. But this is my opinion.