From 451820bd3bcfdfa77bbf5c0b103f801c975e58f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20P=C3=B6tzl?= <115746022+josef-poetzl@users.noreply.github.com> Date: Tue, 8 Oct 2024 08:28:07 +0200 Subject: [PATCH] merge changes from joyfullservice/dev (#12) * Avoid redundant scans for legacy source files These calls only need to be run during a full export. Definitely not repeated for each object exported. We may do some further cleanup later as some of these legacy files are far enough removed from the current version that the checks are probably no longer needed. See #527 * Improve performance on get relations QuickCount When working over a VPN on a database with linked tables, DCount was significantly faster in quickly getting a count of relationships, cutting down overall export (scan) time significantly. * Fix incompatible Access SQL data type Fixes #533 * Remove orphaned TableDef *.sql files Include *.sql in the list of extensions related to TableDef objects. Fixes #536 --------- Co-authored-by: joyfullservice --- Version Control.accda.src/modules/clsDbRelation.cls | 3 ++- Version Control.accda.src/modules/clsDbTableDef.cls | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Version Control.accda.src/modules/clsDbRelation.cls b/Version Control.accda.src/modules/clsDbRelation.cls index e0dcf5e4..d9e1433a 100644 --- a/Version Control.accda.src/modules/clsDbRelation.cls +++ b/Version Control.accda.src/modules/clsDbRelation.cls @@ -411,7 +411,8 @@ End Property ' Private Property Get IDbComponent_QuickCount() As Long Static lngCount As Long - If lngCount = 0 Then lngCount = CurrentDb.Relations.Count - 1 + ' DCount is much faster than CurrentDb.Relations.Count in some cases. + If lngCount = 0 Then lngCount = DCount("*", "MSysRelationships") - 1 IDbComponent_QuickCount = lngCount + 1 End Property diff --git a/Version Control.accda.src/modules/clsDbTableDef.cls b/Version Control.accda.src/modules/clsDbTableDef.cls index 17775795..896153c4 100644 --- a/Version Control.accda.src/modules/clsDbTableDef.cls +++ b/Version Control.accda.src/modules/clsDbTableDef.cls @@ -504,7 +504,7 @@ Private Function GetTypeString(intType As DAO.DataTypeEnum) As String Case dbMemo: GetTypeString = "LONGTEXT" Case dbDouble: GetTypeString = "DOUBLE" Case dbSingle: GetTypeString = "SINGLE" - Case dbByte: GetTypeString = "UNSIGNED BYTE" + Case dbByte: GetTypeString = "BYTE" Case dbInteger: GetTypeString = "SHORT" Case dbLong: GetTypeString = "LONG" Case dbNumeric: GetTypeString = "NUMERIC" @@ -802,6 +802,7 @@ Private Property Get IDbComponent_FileExtensions() As Collection Set IDbComponent_FileExtensions = New Collection IDbComponent_FileExtensions.Add "xml" IDbComponent_FileExtensions.Add "json" + IDbComponent_FileExtensions.Add "sql" End Property