Skip to content

Commit

Permalink
Discard column metadata on pass-through query export
Browse files Browse the repository at this point in the history
Dynamically generated column information seems to change during normal usage of pass-through queries between database builds. Discarding this information reduces the "noise" of source changes when no actual design changes were made to the objects. Closes #182
  • Loading branch information
joyfullservice committed Feb 24, 2021
1 parent 0961caa commit c098927
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Version Control.accda.src/dbs-properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"Type": 10
},
"AppVersion": {
"Value": "3.3.1",
"Value": "3.3.2",
"Type": 10
},
"Auto Compact": {
Expand Down
24 changes: 23 additions & 1 deletion Version Control.accda.src/modules/modSanitize.bas
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Option Compare Database
Option Private Module
Option Explicit

Private Const ModuleName = "modSanitize"


'---------------------------------------------------------------------------------------
' Procedure : SanitizeFile
Expand All @@ -27,8 +29,11 @@ Public Sub SanitizeFile(strPath As String)
Dim blnInsideIgnoredBlock As Boolean
Dim intIndent As Integer
Dim blnIsReport As Boolean
Dim blnIsPassThroughQuery As Boolean
Dim sngStartTime As Single
Dim strTempFile As String

On Error Resume Next

' Read text from file, and split into lines
If HasUcs2Bom(strPath) Then
Expand Down Expand Up @@ -125,7 +130,16 @@ Public Sub SanitizeFile(strPath As String)
' Turn flag on to ignore Right and Bottom lines
blnIsReport = True
cData.Add strLine


' Beginning of main section
Case "Begin"
If blnIsPassThroughQuery And Options.AggressiveSanitize Then
' Ignore remaining content. (See Issue #182)
Exit Do
Else
cData.Add strLine
End If

Case Else
If blnInsideIgnoredBlock Then
' Skip if we are in an ignored block
Expand All @@ -150,6 +164,11 @@ Public Sub SanitizeFile(strPath As String)
Else
' All other lines will be added.
cData.Add strLine

' Check for pass-through query connection string
If StartsWith(strLine, "dbMemo ""Connect"" =""") Then
blnIsPassThroughQuery = True
End If
End If

End Select
Expand All @@ -169,6 +188,9 @@ Public Sub SanitizeFile(strPath As String)
' Replace original file with sanitized version
WriteFile cData.GetStr, strPath

' Log any errors
CatchAny eelError, "Error sanitizing file " & FSO.GetFileName(strPath), ModuleName & ".SanitizeFile"

End Sub


Expand Down
2 changes: 1 addition & 1 deletion Version Control.accda.src/vbe-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"Items": {
"Name": "MSAccessVCS",
"Description": "Version 3.3.0 deployed on 2/23/2021",
"Description": "Version 3.3.2 deployed on 2/24/2021",
"FileName": "rel:Version Control.accda",
"HelpFile": "",
"HelpContextId": 0,
Expand Down
2 changes: 1 addition & 1 deletion Version Control.accda.src/vcs-options.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Info": {
"AddinVersion": "3.3.0",
"AddinVersion": "3.3.2",
"AccessVersion": "14.0 32-bit"
},
"Options": {
Expand Down

0 comments on commit c098927

Please sign in to comment.