Skip to content

Commit 25bbf35

Browse files
committed
SQLiteCMeta, refactoring, cleanup
1 parent ff84ba6 commit 25bbf35

15 files changed

+440
-276
lines changed

Project/SQLite/C/ADemo/SQLiteCExamples.bas

+6-2
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ End Function
347347
Private Sub GetTableMetaFunctions()
348348
Dim dbs As SQLiteCStatement
349349
Set dbs = this.dbs
350+
Dim dbsm As SQLiteCMeta
351+
Set dbsm = SQLiteCMeta(dbs)
350352
Dim ResultCode As SQLiteResultCodes
351353

352354
Dim SQLQuery As String
@@ -372,7 +374,7 @@ Private Sub GetTableMetaFunctions()
372374
"Failed to execute the Step API."
373375
End Select
374376

375-
ResultCode = dbs.DbExecutor.TableMetaCollect
377+
ResultCode = dbsm.TableMetaCollect
376378
If ResultCode <> SQLITE_OK Then
377379
Err.Raise ErrNo.UnknownClassErr, "SQLiteCExamples", _
378380
"Failed to get columns meta."
@@ -393,6 +395,8 @@ End Sub
393395
Private Sub GetTableMeta()
394396
Dim dbs As SQLiteCStatement
395397
Set dbs = this.dbs
398+
Dim dbsm As SQLiteCMeta
399+
Set dbsm = SQLiteCMeta(dbs)
396400
Dim ResultCode As SQLiteResultCodes
397401

398402
Dim SQLQuery As String
@@ -418,7 +422,7 @@ Private Sub GetTableMeta()
418422
"Failed to execute the Step API."
419423
End Select
420424

421-
ResultCode = dbs.DbExecutor.TableMetaCollect
425+
ResultCode = dbsm.TableMetaCollect
422426
If ResultCode <> SQLITE_OK Then
423427
Err.Raise ErrNo.UnknownClassErr, "SQLiteCExamples", _
424428
"Failed to get columns meta."

Project/SQLite/C/Connection/SQLiteCConnection.cls

+3
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ End Function
293293
'@Description "Queries database access mode."
294294
Public Function AccessMode(Optional ByVal SchemaAlias As String = "main" _
295295
) As SQLiteDbAccess
296+
Attribute AccessMode.VB_Description = "Queries database access mode."
296297
FixGuard.DbNotOpened Me, "SQLiteCConnection/AccessMode"
297298
Dim SchemaUTF8() As Byte
298299
SchemaUTF8 = UTFlib.UTF8BytesFromStr(SchemaAlias)
@@ -304,6 +305,7 @@ End Function
304305
''''
305306
'@Description "Queries the number of changes occured during the last executed statement or since the DBO creation."
306307
Public Function ChangesCount(Optional ByVal Total As Boolean = False) As Long
308+
Attribute ChangesCount.VB_Description = "Queries the number of changes occured during the last executed statement or since the DBO creation."
307309
FixGuard.DbNotOpened Me, "SQLiteCConnection/ChangesCount"
308310
If Total Then
309311
ChangesCount = sqlite3_total_changes(this.DbHandle)
@@ -324,6 +326,7 @@ End Function
324326
'@Description "Executes a plain-text non-query via a convenience shortcut."
325327
Public Function ExecuteNonQueryPlain(ByVal SQLQuery As String, _
326328
Optional ByRef AffectedRows As Long = -1) As SQLiteResultCodes
329+
Attribute ExecuteNonQueryPlain.VB_Description = "Executes a plain-text non-query via a convenience shortcut."
327330
Guard.EmptyString SQLQuery
328331
FixGuard.DbNotOpened Me, "SQLiteCConnection/ExecuteNonQueryPlain"
329332
If AffectedRows <> -1 Then AffectedRows = ChangesCount(True)

Project/SQLite/C/Connection/SQLiteCConnectionOpenCloseTests.bas

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
Attribute VB_Name = "SQLiteCConnectionOpenCloseTests"
22
'@Folder "SQLite.C.Connection"
33
'@TestModule
4-
'@IgnoreModule AssignmentNotUsed, LineLabelNotUsed, VariableNotUsed, ProcedureNotUsed, UnhandledOnErrorResumeNext
4+
'@IgnoreModule AssignmentNotUsed, LineLabelNotUsed, VariableNotUsed, ProcedureNotUsed
5+
'@IgnoreModule UnhandledOnErrorResumeNext, FunctionReturnValueDiscarded
56
Option Explicit
67
Option Private Module
78

Project/SQLite/C/RecordsetADO/SQLiteCRecordsetADO.cls

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Attribute VB_GlobalNameSpace = False
77
Attribute VB_Creatable = False
88
Attribute VB_PredeclaredId = True
99
Attribute VB_Exposed = True
10-
Attribute VB_Description = "Constructs ADO Recordset"
10+
Attribute VB_Description = "Constructs ADO Recordset using table metadata."
1111
'@Folder "SQLite.C.RecordsetADO"
1212
'@ModuleDescription "Constructs ADO Recordset using table metadata."
1313
'@Exposed

Project/SQLite/C/RecordsetADO/SQLiteCRecordsetADOTests.bas

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ Arrange:
6161
Set dbc = FixObjC.GetDBCMem
6262
Dim dbs As SQLiteCStatement
6363
Set dbs = dbc.CreateStatement(vbNullString)
64+
Dim dbsm As SQLiteCMeta
65+
Set dbsm = SQLiteCMeta(dbs)
6466

6567
Dim ResultCode As SQLiteResultCodes
6668
ResultCode = dbc.OpenDb
@@ -74,7 +76,7 @@ Act:
7476
SQLQuery = FixSQLITRB.SelectRowid
7577
ResultCode = dbs.Prepare16V2(SQLQuery)
7678
Assert.AreEqual SQLITE_OK, ResultCode, "Unexpected Prepare16V2 error."
77-
ResultCode = dbs.DbExecutor.TableMetaCollect
79+
ResultCode = dbsm.TableMetaCollect
7880
Assert.AreEqual SQLITE_OK, ResultCode, "Unexpected GetTableMeta error."
7981
Assert.AreEqual 0, AffectedRows, "AffectedRows mismatch"
8082

Project/SQLite/C/SQLiteCConst.bas

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Public Type SQLiteCColumnMeta
7070
DbName As String
7171
TableName As String
7272
OriginName As String
73-
DataType As SQLiteDataType
73+
' DataType As SQLiteDataType
7474
TableMeta As Boolean '''' Set to True if table meta is available
7575
DeclaredTypeC As String
7676
Affinity As SQLiteTypeAffinity

0 commit comments

Comments
 (0)