-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aggressive and Advanced sanitize levels remove necessary properties from some queries #337
Comments
@grv87, are you able to set the sanitize level lower and get what you need out of the columns? Unless I'm mistaken, the At least in my testing, Can you give some context for what you're doing with those properties? Perhaps we could tweak the sanitize levels and add a |
@hecon5, I get what I need with Basic level. But I also get GUIDs and some other properties that (I agree) could be removed. I can't tell in general, just in my case. I have about 10 complex SQL queries, and not all of them have these properties.
I'm using Access 365. |
Ah, I see. If a query goes to an external database, then Access could get some additional information from it, so it probably can be discarded. But my queries don't use any external databases. They are just complex SQLs that can't be presented in Design view. I wrote them by hand. |
Are you directly showing users queries in split forms? It kinda sounds like you are (wanting to understand what the use case is). If so, would a Datasheet type form be better if possible as it would be independent of the sub-query and you'd directly set formatting for the particular view. This avoids needing a specific column order or other formatting details, but would create another form, I recognize. This would also allow you to hide PKs and / or other fields you don't want for some views, and keep the data there for sorting, as well as ensure you show users exactly what you want regardless of the query formatting or data type. it would also allow you to re-use a query for different context views and not maintain separate queries for essentially the same data set. We use these occasionally when the roll-up (Datasheet) we don't want all the details (eg: display short date vice the full timestamp for "date signed" type fields, but on the individual record we want the full stamp for review purposes). Or we have effectively a GUID as a PK, but that is basically unintelligible on a Datasheet (cue glazed over eyes) because it's not useful data. So we hide it on the datasheet roll-up, but it displays on the split form field (because it's actually useful one at a time in some instances). |
I don't have (or need) any forms, just views. |
According to docs, passthrough queries should have So, the problem is here: I checked my queries. Their UPD: But they have |
@grv87 - To clarify, are you saying that the handwritten SQL queries using only local tables have a Connect property with an empty string, as shown in the exported source file? If that's the case, then it sounds like these are being incorrectly flagged as pass-through queries as you pointed out in the above code lines. If this is the case, we can add a second test to make sure that queries with an empty connection string are not flagged as pass-through queries for the purpose of sanitizing the content. What happens if you change line 208 to the following? Let me know if that fixes the issue for you... |
Yes.
It (mostly) fixes it. But I don't have pass-through queries, so can't say for everybody else. P.S. By mostly I mean that it keeps |
Queries that are not pass-through queries may have a blank connection string property in the exported text file. Only queries where "Connect" has a value should be considered pass-through queries for the purpose of sanitization. #337
I have review the source files for pass-through queries, and this does work as expected.
Yes, I agree, that would be a more robust way of determining the query type. However, the sanitization function is several layers removed from the actual database object, so it's not something we can readily access in that context. This could be refactored in the future, but for now checking the length of the property seems reasonable enough for our purposes.
The main purpose for sanitizing these properties at all was that in pass-through queries they would (seemingly randomly) come and go, depending on whether that query had been run since the last export. This created a lot of "noise" in the export files and required careful review each time to make sure you were not missing actual changes. Sanitizing out the column information on (only) the pass-through queries resolved the issue for me and provided nice and clean exports that only reflected actual changes to the pass-through query code. As a general rule, I try to only tweak those things that cause actual problems for version control, and leave the rest of the exported file as intact as possible. |
Is this still a thing? IIRC there was some refactoring of the sanitize functions/class that may address this. |
#182 took a very daring approach.
ColumnWidth
,ColumnOrder
,DecimalPlaces
,Format
,ColumnHidden (=-1)
,AggregateType (<> -1)
properties are necessary.They cannot be deduced from SQL. And they are used in the real world.
Please, get them back for Aggressive and/or Advanced sanitize levels.
The text was updated successfully, but these errors were encountered: