From dc92cdabef771287f7cd0a8979a2fb3c4c534d69 Mon Sep 17 00:00:00 2001 From: BernardoContreras Date: Sun, 13 Jul 2025 20:46:41 -0300 Subject: [PATCH 01/12] use builder in SQLite3Database>>inspectionSQLite3Tables: --- src/SQLite3-Inspector-Extensions/SQLite3Database.extension.st | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SQLite3-Inspector-Extensions/SQLite3Database.extension.st b/src/SQLite3-Inspector-Extensions/SQLite3Database.extension.st index 0b1f4e3..03c4bd8 100644 --- a/src/SQLite3-Inspector-Extensions/SQLite3Database.extension.st +++ b/src/SQLite3-Inspector-Extensions/SQLite3Database.extension.st @@ -1,10 +1,10 @@ Extension { #name : 'SQLite3Database' } { #category : '*SQLite3-Inspector-Extensions' } -SQLite3Database >> inspectionSQLite3Tables [ +SQLite3Database >> inspectionSQLite3Tables: aBuilder [ - ^ SpTablePresenter new + ^ aBuilder newTable items: self tables; beResizable; addColumn: (SpStringTableColumn title: 'Name' evaluated: [ :assoc | assoc name ]); From 312d555bef1c12208c799393544a42521a71e277 Mon Sep 17 00:00:00 2001 From: BernardoContreras Date: Sun, 13 Jul 2025 20:52:57 -0300 Subject: [PATCH 02/12] use builder in SQLite3Table>>#inspectionSQLite3Schema: --- .../SQLite3Table.extension.st | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st b/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st index 11cc62e..ccc9ff4 100644 --- a/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st +++ b/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st @@ -40,12 +40,12 @@ SQLite3Table >> inspectionSQLite3Data [ ] { #category : '*SQLite3-Inspector-Extensions' } -SQLite3Table >> inspectionSQLite3Schema [ - +SQLite3Table >> inspectionSQLite3Schema: aBuilder [ - ^ SpTextPresenter new - text: self schema; - yourself + + ^ aBuilder newText + text: self schema; + yourself ] { #category : '*SQLite3-Inspector-Extensions' } From d9fa7afba60d68ce188eecb9b9baff0df48da59e Mon Sep 17 00:00:00 2001 From: BernardoContreras Date: Sun, 13 Jul 2025 21:04:38 -0300 Subject: [PATCH 03/12] use builder in SQLite3Table>>#inspectionSQLite3Data: --- .../SQLite3Table.extension.st | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st b/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st index ccc9ff4..0129a68 100644 --- a/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st +++ b/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st @@ -24,18 +24,19 @@ SQLite3Table >> inspectionSQLite3Columns [ ] { #category : '*SQLite3-Inspector-Extensions' } -SQLite3Table >> inspectionSQLite3Data [ +SQLite3Table >> inspectionSQLite3Data: aBuilder [ | presenter | - presenter := SpTablePresenter new + presenter := aBuilder newTable items: self rows; beResizable; + alternateRowsColor; yourself. - - self columnNames do: [ :col | - presenter addColumn: - (SpStringTableColumn title: col evaluated: [ :each | each at: col ]) ]. + presenter addColumns: (self columnNames collect: [ :name | + SpStringTableColumn + title: name + evaluated: [ :row | row atName: name ] ]). ^ presenter ] From 88f25750cc276048d33b792dccbefb541c073857 Mon Sep 17 00:00:00 2001 From: BernardoContreras Date: Sun, 13 Jul 2025 21:36:26 -0300 Subject: [PATCH 04/12] use builder in SQLite3Table>>#inspectionSQLite3Columns: --- .../SQLite3Table.extension.st | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st b/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st index 0129a68..d365620 100644 --- a/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st +++ b/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st @@ -1,25 +1,32 @@ Extension { #name : 'SQLite3Table' } { #category : '*SQLite3-Inspector-Extensions' } -SQLite3Table >> inspectionSQLite3Columns [ +SQLite3Table >> inspectionSQLite3Columns: aBuilder [ - ^ SpTablePresenter new + ^ aBuilder newTable items: self columns; beResizable; - addColumn: (SpStringTableColumn - title: 'Column Name' + alternateRowsColor; + addColumn: + (SpStringTableColumn + title: 'Index' + evaluated: [ :each | each index ]); + addColumn: + (SpStringTableColumn + title: 'Name' evaluated: [ :each | each name ]); - addColumn: (SpStringTableColumn - title: 'Column Type' + addColumn: + (SpStringTableColumn + title: 'Type' evaluated: [ :each | each type ]); addColumn: (SpStringTableColumn title: 'Non-empty values' evaluated: [ :each | - each hasNotNullConstraint - ifTrue: [ 'NOT NULL' ] - ifFalse: [ '' ] ]); + each hasNotNullConstraint + ifTrue: [ 'NOT NULL' ] + ifFalse: [ '' ] ]); yourself ] From 3dce89902b95c1f6cb87df0fb9c862f7ca336d52 Mon Sep 17 00:00:00 2001 From: BernardoContreras Date: Sun, 13 Jul 2025 21:40:08 -0300 Subject: [PATCH 05/12] use builder in SQLite3Table>>#inspectionSQLite3TableProperties: --- src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st b/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st index d365620..0971161 100644 --- a/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st +++ b/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st @@ -57,12 +57,13 @@ SQLite3Table >> inspectionSQLite3Schema: aBuilder [ ] { #category : '*SQLite3-Inspector-Extensions' } -SQLite3Table >> inspectionSQLite3TableProperties [ +SQLite3Table >> inspectionSQLite3TableProperties: aBuilder [ - ^ SpTablePresenter new + ^ aBuilder newTable items: self properties associations; beResizable; + alternateRowsColor; addColumn: (SpStringTableColumn title: 'Property' evaluated: [ :assoc | assoc key ]); From 14d3618d2f149d9118383ccaa7f41686d1347fe0 Mon Sep 17 00:00:00 2001 From: BernardoContreras Date: Sun, 13 Jul 2025 21:48:50 -0300 Subject: [PATCH 06/12] use builder in SQLite3Row>>#inspectionSQLite3Row: --- .../SQLite3Row.extension.st | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st b/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st index 8ff640b..75aa570 100644 --- a/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st +++ b/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st @@ -1,16 +1,16 @@ Extension { #name : 'SQLite3Row' } { #category : '*SQLite3-Inspector-Extensions' } -SQLite3Row >> inspectionSQLite3Row [ - +SQLite3Row >> inspectionSQLite3Row: aBuilder [ + | presenter | - presenter := SpTablePresenter new. - presenter items: (Array with: self). - self columnNames do: [:each | - presenter addColumn: (SpStringTableColumn title: each evaluated: [ :assoc | self at: each ]) - - ]. - - ^presenter + presenter := aBuilder newTable. + presenter + items: (Array with: self); + addColumns: (self columnNames collect: [ :columnName | + SpStringTableColumn + title: columnName + evaluated: [ :row | row atName: columnName ] ]). + ^ presenter ] From db4cffd3138cf0e40426a6cf82d9a0ef77b07f51 Mon Sep 17 00:00:00 2001 From: BernardoContreras Date: Sun, 13 Jul 2025 21:54:51 -0300 Subject: [PATCH 07/12] better SQLite3Database>>#inspectionSQLite3Tables: --- .../SQLite3Database.extension.st | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/SQLite3-Inspector-Extensions/SQLite3Database.extension.st b/src/SQLite3-Inspector-Extensions/SQLite3Database.extension.st index 03c4bd8..98c2cf4 100644 --- a/src/SQLite3-Inspector-Extensions/SQLite3Database.extension.st +++ b/src/SQLite3-Inspector-Extensions/SQLite3Database.extension.st @@ -2,12 +2,18 @@ Extension { #name : 'SQLite3Database' } { #category : '*SQLite3-Inspector-Extensions' } SQLite3Database >> inspectionSQLite3Tables: aBuilder [ - + ^ aBuilder newTable - items: self tables; - beResizable; - addColumn: (SpStringTableColumn title: 'Name' evaluated: [ :assoc | assoc name ]); - addColumn: (SpStringTableColumn title: 'Number of rows' evaluated: [ :assoc | assoc numberOfRows ]); - yourself + items: self tables; + beResizable; + alternateRowsColor; + addColumn: + (SpStringTableColumn + title: 'Name' + evaluated: [ :table | table name ]); + addColumn: (SpStringTableColumn + title: 'Number of rows' + evaluated: [ :table | table numberOfRows ]); + yourself ] From 94f8ba7659826268e807bd585bd2a5e1734aafc2 Mon Sep 17 00:00:00 2001 From: BernardoContreras Date: Sun, 13 Jul 2025 22:34:40 -0300 Subject: [PATCH 08/12] use builder in AbstractFileReference>>#inspectionSQLite3Tables: and remove SQLite3Database class>>#tableInfoFor: --- .../FFIExternalReference.extension.st | 4 +- .../FFIExternalResourceManager.extension.st | 4 +- src/SQLite3-Core/SQLite3Abort.class.st | 10 +- .../SQLite3AbortRollback.class.st | 10 +- .../SQLite3AbstractError.class.st | 14 +- .../SQLite3AuthorizationDenied.class.st | 10 +- src/SQLite3-Core/SQLite3Backup.class.st | 44 ++-- .../SQLite3BackupExternalReference.class.st | 10 +- .../SQLite3BaseConnection.class.st | 86 +++---- src/SQLite3-Core/SQLite3Busy.class.st | 10 +- src/SQLite3-Core/SQLite3BusyRecovery.class.st | 10 +- src/SQLite3-Core/SQLite3BusySnapshot.class.st | 10 +- src/SQLite3-Core/SQLite3CantOpen.class.st | 10 +- .../SQLite3CantOpenConvertPath.class.st | 10 +- .../SQLite3CantOpenFullPath.class.st | 10 +- .../SQLite3CantOpenIsDir.class.st | 10 +- .../SQLite3CantOpenNoTempDir.class.st | 10 +- src/SQLite3-Core/SQLite3Column.class.st | 30 +-- src/SQLite3-Core/SQLite3Connection.class.st | 24 +- src/SQLite3-Core/SQLite3Constants.class.st | 24 +- .../SQLite3ConstraintViolation.class.st | 10 +- .../SQLite3ConstraintViolationCheck.class.st | 10 +- ...ite3ConstraintViolationCommitHook.class.st | 10 +- ...ite3ConstraintViolationForeignKey.class.st | 10 +- ...QLite3ConstraintViolationFunction.class.st | 10 +- ...SQLite3ConstraintViolationNotNull.class.st | 10 +- ...ite3ConstraintViolationPrimaryKey.class.st | 10 +- .../SQLite3ConstraintViolationRowID.class.st | 10 +- ...SQLite3ConstraintViolationTrigger.class.st | 10 +- .../SQLite3ConstraintViolationUnique.class.st | 10 +- ...e3ConstraintViolationVirtualTable.class.st | 10 +- src/SQLite3-Core/SQLite3Corrupt.class.st | 10 +- .../SQLite3CorruptVirtualTable.class.st | 10 +- src/SQLite3-Core/SQLite3Cursor.class.st | 48 ++-- src/SQLite3-Core/SQLite3Database.class.st | 41 ++-- .../SQLite3DatabaseExternalObject.class.st | 14 +- src/SQLite3-Core/SQLite3DoneResult.class.st | 10 +- src/SQLite3-Core/SQLite3Empty.class.st | 10 +- src/SQLite3-Core/SQLite3Error.class.st | 10 +- src/SQLite3-Core/SQLite3Format.class.st | 10 +- src/SQLite3-Core/SQLite3Full.class.st | 10 +- src/SQLite3-Core/SQLite3IOError.class.st | 10 +- .../SQLite3IOErrorAccess.class.st | 10 +- .../SQLite3IOErrorBlocked.class.st | 10 +- .../SQLite3IOErrorCheckReservedLock.class.st | 10 +- src/SQLite3-Core/SQLite3IOErrorClose.class.st | 10 +- .../SQLite3IOErrorConvertPath.class.st | 10 +- .../SQLite3IOErrorDelete.class.st | 10 +- .../SQLite3IOErrorDeleteNoEntry.class.st | 10 +- .../SQLite3IOErrorDirClose.class.st | 10 +- .../SQLite3IOErrorDirFSync.class.st | 10 +- src/SQLite3-Core/SQLite3IOErrorFStat.class.st | 10 +- src/SQLite3-Core/SQLite3IOErrorFSync.class.st | 10 +- .../SQLite3IOErrorGetTempPath.class.st | 10 +- src/SQLite3-Core/SQLite3IOErrorLock.class.st | 10 +- .../SQLite3IOErrorMemoryMap.class.st | 10 +- .../SQLite3IOErrorNoMemory.class.st | 10 +- src/SQLite3-Core/SQLite3IOErrorRead.class.st | 10 +- .../SQLite3IOErrorReadLock.class.st | 10 +- src/SQLite3-Core/SQLite3IOErrorSeek.class.st | 10 +- .../SQLite3IOErrorSharedMemoryError.class.st | 10 +- .../SQLite3IOErrorSharedMemoryLock.class.st | 10 +- .../SQLite3IOErrorSharedMemoryMap.class.st | 10 +- .../SQLite3IOErrorSharedMemoryOpen.class.st | 10 +- .../SQLite3IOErrorSharedMemorySize.class.st | 10 +- .../SQLite3IOErrorShortRead.class.st | 10 +- .../SQLite3IOErrorTruncate.class.st | 10 +- .../SQLite3IOErrorUnlock.class.st | 10 +- src/SQLite3-Core/SQLite3IOErrorWrite.class.st | 10 +- src/SQLite3-Core/SQLite3Internal.class.st | 10 +- src/SQLite3-Core/SQLite3Interrupt.class.st | 10 +- src/SQLite3-Core/SQLite3Library.class.st | 218 +++++++++--------- src/SQLite3-Core/SQLite3Locked.class.st | 10 +- .../SQLite3LockedSharedCache.class.st | 10 +- src/SQLite3-Core/SQLite3LogNotice.class.st | 10 +- .../SQLite3LogNoticeRecoverRollback.class.st | 10 +- ...LogNoticeRecoverWriteAheadLogging.class.st | 10 +- src/SQLite3-Core/SQLite3LogWarning.class.st | 10 +- .../SQLite3LogWarningAutoIndex.class.st | 10 +- src/SQLite3-Core/SQLite3Mismatch.class.st | 10 +- src/SQLite3-Core/SQLite3Misuse.class.st | 10 +- src/SQLite3-Core/SQLite3NativeError.class.st | 18 +- .../SQLite3NoLargeFileSupport.class.st | 10 +- src/SQLite3-Core/SQLite3NoMemory.class.st | 10 +- src/SQLite3-Core/SQLite3NotADatabase.class.st | 10 +- src/SQLite3-Core/SQLite3NotFound.class.st | 10 +- src/SQLite3-Core/SQLite3NotOpen.class.st | 8 +- src/SQLite3-Core/SQLite3OKResult.class.st | 10 +- src/SQLite3-Core/SQLite3OutOfRange.class.st | 10 +- src/SQLite3-Core/SQLite3Permission.class.st | 10 +- .../SQLite3PreparedStatement.class.st | 108 ++++----- src/SQLite3-Core/SQLite3Protocol.class.st | 10 +- src/SQLite3-Core/SQLite3ReadOnly.class.st | 10 +- .../SQLite3ReadOnlyCantLock.class.st | 10 +- .../SQLite3ReadOnlyDBMoved.class.st | 10 +- .../SQLite3ReadOnlyRecovery.class.st | 10 +- .../SQLite3ReadOnlyRollback.class.st | 10 +- src/SQLite3-Core/SQLite3Result.class.st | 16 +- src/SQLite3-Core/SQLite3Row.class.st | 50 ++-- src/SQLite3-Core/SQLite3RowResult.class.st | 10 +- .../SQLite3SchemaChanged.class.st | 10 +- .../SQLite3StatementExternalObject.class.st | 14 +- src/SQLite3-Core/SQLite3Table.class.st | 32 +-- src/SQLite3-Core/SQLite3TooBig.class.st | 10 +- src/SQLite3-Core/package.st | 2 +- .../AbstractFileReference.extension.st | 11 +- 106 files changed, 926 insertions(+), 734 deletions(-) diff --git a/src/SQLite3-Core/FFIExternalReference.extension.st b/src/SQLite3-Core/FFIExternalReference.extension.st index d0cf842..6b435c7 100644 --- a/src/SQLite3-Core/FFIExternalReference.extension.st +++ b/src/SQLite3-Core/FFIExternalReference.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FFIExternalReference } +Extension { #name : 'FFIExternalReference' } -{ #category : #'*SQLite3-Core' } +{ #category : '*SQLite3-Core' } FFIExternalReference >> manualRelease [ FFIExternalResourceManager uniqueInstance removeResource: self ] diff --git a/src/SQLite3-Core/FFIExternalResourceManager.extension.st b/src/SQLite3-Core/FFIExternalResourceManager.extension.st index 9f223fe..a2da23b 100644 --- a/src/SQLite3-Core/FFIExternalResourceManager.extension.st +++ b/src/SQLite3-Core/FFIExternalResourceManager.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FFIExternalResourceManager } +Extension { #name : 'FFIExternalResourceManager' } -{ #category : #'*SQLite3-Core' } +{ #category : '*SQLite3-Core' } FFIExternalResourceManager >> removeResource: anObject [ registry remove: anObject ifAbsent: [ ] ] diff --git a/src/SQLite3-Core/SQLite3Abort.class.st b/src/SQLite3-Core/SQLite3Abort.class.st index d847e65..ccbf9ed 100644 --- a/src/SQLite3-Core/SQLite3Abort.class.st +++ b/src/SQLite3-Core/SQLite3Abort.class.st @@ -10,12 +10,14 @@ If a ROLLBACK operation occurs on the same database connection as a pending read In addition to being a result code, the SQLITE_ABORT value is also used as a conflict resolution mode returned from the sqlite3_vtab_on_conflict() interface. " Class { - #name : #SQLite3Abort, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3Abort', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Abort class >> nativeErrorCode [ ^ SQLITE_ABORT diff --git a/src/SQLite3-Core/SQLite3AbortRollback.class.st b/src/SQLite3-Core/SQLite3AbortRollback.class.st index febae75..2a7f3dc 100644 --- a/src/SQLite3-Core/SQLite3AbortRollback.class.st +++ b/src/SQLite3-Core/SQLite3AbortRollback.class.st @@ -2,12 +2,14 @@ The SQLITE_ABORT_ROLLBACK error code is an extended error code for SQLITE_ABORT indicating that an SQL statement aborted because the transaction that was active when the SQL statement first started was rolled back. Pending write operations always fail with this error when a rollback occurs. A ROLLBACK will cause a pending read operation to fail only if the schema was changed within the transaction being rolled back. " Class { - #name : #SQLite3AbortRollback, - #superclass : #SQLite3Abort, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3AbortRollback', + #superclass : 'SQLite3Abort', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3AbortRollback class >> nativeErrorCode [ ^ SQLITE_ABORT_ROLLBACK diff --git a/src/SQLite3-Core/SQLite3AbstractError.class.st b/src/SQLite3-Core/SQLite3AbstractError.class.st index 819572c..092e307 100644 --- a/src/SQLite3-Core/SQLite3AbstractError.class.st +++ b/src/SQLite3-Core/SQLite3AbstractError.class.st @@ -2,26 +2,28 @@ I represent an SQLite non-ok condition. " Class { - #name : #SQLite3AbstractError, - #superclass : #Error, + #name : 'SQLite3AbstractError', + #superclass : 'Error', #instVars : [ 'resultCode' ], - #category : #'SQLite3-Core-Errors' + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #testing } +{ #category : 'testing' } SQLite3AbstractError class >> isAbstract [ ^self name = #SQLite3AbstractError ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3AbstractError >> resultCode [ ^ resultCode ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3AbstractError >> resultCode: anObject [ resultCode := anObject ] diff --git a/src/SQLite3-Core/SQLite3AuthorizationDenied.class.st b/src/SQLite3-Core/SQLite3AuthorizationDenied.class.st index 12e4c58..c8daca9 100644 --- a/src/SQLite3-Core/SQLite3AuthorizationDenied.class.st +++ b/src/SQLite3-Core/SQLite3AuthorizationDenied.class.st @@ -4,12 +4,14 @@ This class comment was automatically generated from https://www.sqlite.org/resco The SQLITE_AUTH error is returned when the authorizer callback indicates that an SQL statement being prepared is not authorized. " Class { - #name : #SQLite3AuthorizationDenied, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3AuthorizationDenied', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3AuthorizationDenied class >> nativeErrorCode [ ^ SQLITE_AUTH diff --git a/src/SQLite3-Core/SQLite3Backup.class.st b/src/SQLite3-Core/SQLite3Backup.class.st index cb5ebd7..6e4aaa0 100644 --- a/src/SQLite3-Core/SQLite3Backup.class.st +++ b/src/SQLite3-Core/SQLite3Backup.class.st @@ -4,8 +4,8 @@ I represent a SQLite backup operation. This is detailed at https://sqlite.org/c3ref/backup_finish.html#sqlite3backupinit " Class { - #name : #SQLite3Backup, - #superclass : #Object, + #name : 'SQLite3Backup', + #superclass : 'Object', #instVars : [ 'library', 'srcConnection', @@ -15,10 +15,12 @@ Class { 'isOpen', 'handle' ], - #category : #'SQLite3-Core-Utilities' + #category : 'SQLite3-Core-Utilities', + #package : 'SQLite3-Core', + #tag : 'Utilities' } -{ #category : #creating } +{ #category : 'creating' } SQLite3Backup class >> to: dConnection named: dName from: sConnection named: sName [ ^(self new) dstConnection: dConnection; @@ -27,32 +29,32 @@ SQLite3Backup class >> to: dConnection named: dName from: sConnection named: sNa srcName: sName ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Backup >> dstConnection [ ^ dstConnection ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Backup >> dstConnection: anObject [ dstConnection := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Backup >> dstName [ ^ dstName ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Backup >> dstName: anObject [ dstName := anObject ] -{ #category : #finalization } +{ #category : 'finalization' } SQLite3Backup >> finalize [ self finish ] -{ #category : #initialization } +{ #category : 'initialization' } SQLite3Backup >> finish [ handle ifNotNil: [ @@ -61,17 +63,17 @@ SQLite3Backup >> finish [ handle := nil] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Backup >> handle [ ^ handle ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Backup >> handle: anObject [ handle := anObject ] -{ #category : #initialization } +{ #category : 'initialization' } SQLite3Backup >> initialize [ super initialize. isOpen := false. @@ -80,44 +82,44 @@ SQLite3Backup >> initialize [ handle autoRelease ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Backup >> isOpen [ ^ isOpen ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Backup >> open [ handle := (library backupTo: dstConnection named: dstName from: srcConnection named: srcName). isOpen := true ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Backup >> srcConnection [ ^ srcConnection ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Backup >> srcConnection: anObject [ srcConnection := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Backup >> srcName [ ^ srcName ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Backup >> srcName: anObject [ srcName := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Backup >> step [ "Passing negative number means run to completion" self step: -1 ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Backup >> step: nPages [ library backup: handle step: nPages diff --git a/src/SQLite3-Core/SQLite3BackupExternalReference.class.st b/src/SQLite3-Core/SQLite3BackupExternalReference.class.st index 2b961b5..5c52525 100644 --- a/src/SQLite3-Core/SQLite3BackupExternalReference.class.st +++ b/src/SQLite3-Core/SQLite3BackupExternalReference.class.st @@ -2,12 +2,14 @@ I represent the SQLite API 'sqlite3_backup' C-level type. " Class { - #name : #SQLite3BackupExternalReference, - #superclass : #FFIOpaqueObject, - #category : #'SQLite3-Core-UFFI-Support' + #name : 'SQLite3BackupExternalReference', + #superclass : 'FFIOpaqueObject', + #category : 'SQLite3-Core-UFFI-Support', + #package : 'SQLite3-Core', + #tag : 'UFFI-Support' } -{ #category : #initialization } +{ #category : 'initialization' } SQLite3BackupExternalReference >> beNull [ ^ handle beNull diff --git a/src/SQLite3-Core/SQLite3BaseConnection.class.st b/src/SQLite3-Core/SQLite3BaseConnection.class.st index 0521736..8c057e9 100644 --- a/src/SQLite3-Core/SQLite3BaseConnection.class.st +++ b/src/SQLite3-Core/SQLite3BaseConnection.class.st @@ -4,8 +4,8 @@ I represent a connection to an SQLite database. I provide a thin wrapper over th Do not use this class directly, please check and use my subclass SQLite3Connection " Class { - #name : #SQLite3BaseConnection, - #superclass : #Object, + #name : 'SQLite3BaseConnection', + #superclass : 'Object', #instVars : [ 'dbFilename', 'dbHandle', @@ -13,36 +13,38 @@ Class { 'library', 'statementClass' ], - #category : #'SQLite3-Core-Connections' + #category : 'SQLite3-Core-Connections', + #package : 'SQLite3-Core', + #tag : 'Connections' } -{ #category : #testing } +{ #category : 'testing' } SQLite3BaseConnection class >> isAbstract [ ^ self == SQLite3BaseConnection ] -{ #category : #testing } +{ #category : 'testing' } SQLite3BaseConnection class >> isThreadsafe [ "Native Library Version http://sqlite.org/c3ref/libversion.html sqlite3_libversion" ^ SQLite3Library current isThreadsafe ~= 0 ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3BaseConnection class >> libraryVersion [ "Native Library Version http://sqlite.org/c3ref/libversion.html sqlite3_libversion" ^ SQLite3Library current libraryVersion ] -{ #category : #examples } +{ #category : 'examples' } SQLite3BaseConnection class >> memory [ ^ self on: ':memory:' ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SQLite3BaseConnection class >> on: aFilename [ ^(self new) @@ -50,7 +52,7 @@ SQLite3BaseConnection class >> on: aFilename [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SQLite3BaseConnection class >> openOn: aFilename [ ^(self new) @@ -59,7 +61,7 @@ SQLite3BaseConnection class >> openOn: aFilename [ yourself ] -{ #category : #testing } +{ #category : 'testing' } SQLite3BaseConnection class >> threadsafe [ "This method is deprecated so consider to migrate." self deprecated: 'Please use #isThreadsafe instead' transformWith: '`@receiver threadsafe' @@ -68,48 +70,48 @@ SQLite3BaseConnection class >> threadsafe [ ^ self isThreadsafe ] -{ #category : #'public API - backups' } +{ #category : 'public API - backups' } SQLite3BaseConnection >> backupDatabaseNamed: sName to: aConnection named: dName [ "database name is either 'main' or 'temp' or the name given to ATTACH DATABASE See article at https://www.oreilly.com/library/view/using-sqlite/9781449394592/re225.html" ^SQLite3Backup to: aConnection handle named: dName from: dbHandle named: sName ] -{ #category : #'public API - backups' } +{ #category : 'public API - backups' } SQLite3BaseConnection >> backupTo: aConnection [ ^self backupTo: aConnection named: 'main' ] -{ #category : #'public API - backups' } +{ #category : 'public API - backups' } SQLite3BaseConnection >> backupTo: aConnection named: aName [ ^SQLite3Backup to: aConnection handle named: aName from: dbHandle named: 'main' ] -{ #category : #'public API - operating' } +{ #category : 'public API - operating' } SQLite3BaseConnection >> basicExecute: anSQLText [ ^ (self prepare: anSQLText) step; finalize "20190302, pierce: This used to invoke sqlite3_exec() which is an SQLite-internal convenience wrapper around prepare/step/finalize. It is now rewritten as seen to handle UTF8-encoded input properly. Rewriting this method breaks the Bobby Tables test which relies on naive SQL string construction to work." ] -{ #category : #'public API - transactional' } +{ #category : 'public API - transactional' } SQLite3BaseConnection >> beginTransaction [ ^ self basicExecute: 'begin' ] -{ #category : #'public API - introspection' } +{ #category : 'public API - introspection' } SQLite3BaseConnection >> changes [ ^ library changes: dbHandle ] -{ #category : #'public API - operating' } +{ #category : 'public API - operating' } SQLite3BaseConnection >> clearBindings: aStatement [ library clearBindings: aStatement handle on: dbHandle ] -{ #category : #'public API - open/close' } +{ #category : 'public API - open/close' } SQLite3BaseConnection >> close [ "Do the minimal work to close the connection. Let FFIExternalResourceManager take care of calling sqlite_close_v2()." @@ -120,7 +122,7 @@ SQLite3BaseConnection >> close [ isOpen := false ] -{ #category : #'public API - introspection' } +{ #category : 'public API - introspection' } SQLite3BaseConnection >> columnNamesFor: aTableName [ self isOpen @@ -137,12 +139,12 @@ SQLite3BaseConnection >> columnNamesFor: aTableName [ ifFalse: [ nil ] ] ] -{ #category : #'public API - transactional' } +{ #category : 'public API - transactional' } SQLite3BaseConnection >> commitTransaction [ ^ self basicExecute: 'commit' ] -{ #category : #'public API - introspection' } +{ #category : 'public API - introspection' } SQLite3BaseConnection >> declaredColumnTypesFor: aTableName [ self isOpen @@ -159,17 +161,17 @@ SQLite3BaseConnection >> declaredColumnTypesFor: aTableName [ ifFalse: [ nil ] ] ] -{ #category : #'public API - extensions' } +{ #category : 'public API - extensions' } SQLite3BaseConnection >> disableExtensions [ ^ library disableLoadExtension: dbHandle ] -{ #category : #'public API - extensions' } +{ #category : 'public API - extensions' } SQLite3BaseConnection >> enableExtensions [ ^ library enableLoadExtension: dbHandle ] -{ #category : #private } +{ #category : 'private' } SQLite3BaseConnection >> existTableNamed: aTableName [ | tableExists s | @@ -181,17 +183,17 @@ SQLite3BaseConnection >> existTableNamed: aTableName [ ^ tableExists ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3BaseConnection >> filename [ ^ dbFilename ] -{ #category : #'public API - operating' } +{ #category : 'public API - operating' } SQLite3BaseConnection >> finalize: aStatementHandle [ library finalize: aStatementHandle on: dbHandle ] -{ #category : #'public API - open/close' } +{ #category : 'public API - open/close' } SQLite3BaseConnection >> forceClose [ "Forces the release of dbHandle, enabling to delete the database file without closing Pharo" @@ -199,18 +201,18 @@ SQLite3BaseConnection >> forceClose [ self close ] -{ #category : #'public API - introspection' } +{ #category : 'public API - introspection' } SQLite3BaseConnection >> getAutoCommit [ ^library getAutoCommit: dbHandle ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3BaseConnection >> handle [ ^dbHandle ] -{ #category : #initialization } +{ #category : 'initialization' } SQLite3BaseConnection >> initialize [ super initialize. isOpen := false. @@ -220,30 +222,30 @@ SQLite3BaseConnection >> initialize [ statementClass := SQLite3PreparedStatement ] -{ #category : #testing } +{ #category : 'testing' } SQLite3BaseConnection >> isOpen [ ^ isOpen ] -{ #category : #'public API - extensions' } +{ #category : 'public API - extensions' } SQLite3BaseConnection >> loadExtension: aFilename [ ^ library loadExtension: dbHandle with: aFilename ] -{ #category : #private } +{ #category : 'private' } SQLite3BaseConnection >> on: aFilename [ dbFilename := aFilename. ^ self ] -{ #category : #'public API - open/close' } +{ #category : 'public API - open/close' } SQLite3BaseConnection >> open [ library open: dbFilename via: dbHandle. isOpen := true ] -{ #category : #'public API - operating' } +{ #category : 'public API - operating' } SQLite3BaseConnection >> prepare: anSQLText [ | s | @@ -253,27 +255,27 @@ SQLite3BaseConnection >> prepare: anSQLText [ ^ s ] -{ #category : #'public API - cleaning' } +{ #category : 'public API - cleaning' } SQLite3BaseConnection >> reset: aStatement [ ^library reset: aStatement handle ] -{ #category : #'public API - transactional' } +{ #category : 'public API - transactional' } SQLite3BaseConnection >> rollbackTransaction [ ^ self basicExecute: 'rollback' ] -{ #category : #private } +{ #category : 'private' } SQLite3BaseConnection >> signal: exceptionClass with: value [ library signal: exceptionClass with: value on: dbHandle ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3BaseConnection >> statementClass [ ^ statementClass ] -{ #category : #'public API - introspection' } +{ #category : 'public API - introspection' } SQLite3BaseConnection >> tableNames [ | tables s | @@ -288,12 +290,12 @@ SQLite3BaseConnection >> tableNames [ ^ tables ] ] -{ #category : #'public API - introspection' } +{ #category : 'public API - introspection' } SQLite3BaseConnection >> totalChanges [ ^ library totalChanges: dbHandle ] -{ #category : #'public API - tracing' } +{ #category : 'public API - tracing' } SQLite3BaseConnection >> traceUsing: callback with: appdata [ library trace: dbHandle with: callback with: appdata ] diff --git a/src/SQLite3-Core/SQLite3Busy.class.st b/src/SQLite3-Core/SQLite3Busy.class.st index d3b36a9..b20b7f3 100644 --- a/src/SQLite3-Core/SQLite3Busy.class.st +++ b/src/SQLite3-Core/SQLite3Busy.class.st @@ -12,12 +12,14 @@ See also: SQLITE_BUSY_RECOVERY and SQLITE_BUSY_SNAPSHOT. The SQLITE_BUSY result code differs from SQLITE_LOCKED in that SQLITE_BUSY indicates a conflict with a separate database connection, probably in a separate process, whereas SQLITE_LOCKED indicates a conflict within the same database connection (or sometimes a database connection with a shared cache). " Class { - #name : #SQLite3Busy, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3Busy', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Busy class >> nativeErrorCode [ ^ SQLITE_BUSY diff --git a/src/SQLite3-Core/SQLite3BusyRecovery.class.st b/src/SQLite3-Core/SQLite3BusyRecovery.class.st index 80bbe34..8894997 100644 --- a/src/SQLite3-Core/SQLite3BusyRecovery.class.st +++ b/src/SQLite3-Core/SQLite3BusyRecovery.class.st @@ -2,12 +2,14 @@ The SQLITE_BUSY_RECOVERY error code is an extended error code for SQLITE_BUSY that indicates that an operation could not continue because another process is busy recovering a WAL mode database file following a crash. The SQLITE_BUSY_RECOVERY error code only occurs on WAL mode databases. " Class { - #name : #SQLite3BusyRecovery, - #superclass : #SQLite3Busy, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3BusyRecovery', + #superclass : 'SQLite3Busy', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3BusyRecovery class >> nativeErrorCode [ ^ SQLITE_BUSY_RECOVERY diff --git a/src/SQLite3-Core/SQLite3BusySnapshot.class.st b/src/SQLite3-Core/SQLite3BusySnapshot.class.st index 55b3f78..97d3b78 100644 --- a/src/SQLite3-Core/SQLite3BusySnapshot.class.st +++ b/src/SQLite3-Core/SQLite3BusySnapshot.class.st @@ -8,12 +8,14 @@ The following scenario illustrates how an SQLITE_BUSY_SNAPSHOT error might arise 3. Process A now tries to write to the database. But process A's view of the database content is now obsolete because process B has modified the database file after process A read from it. Hence process A gets an SQLITE_BUSY_SNAPSHOT error. " Class { - #name : #SQLite3BusySnapshot, - #superclass : #SQLite3Busy, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3BusySnapshot', + #superclass : 'SQLite3Busy', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3BusySnapshot class >> nativeErrorCode [ ^ SQLITE_BUSY_SNAPSHOT diff --git a/src/SQLite3-Core/SQLite3CantOpen.class.st b/src/SQLite3-Core/SQLite3CantOpen.class.st index 297b310..31cc38d 100644 --- a/src/SQLite3-Core/SQLite3CantOpen.class.st +++ b/src/SQLite3-Core/SQLite3CantOpen.class.st @@ -4,12 +4,14 @@ This class comment was automatically generated from https://www.sqlite.org/resco The SQLITE_CANTOPEN result code indicates that SQLite was unable to open a file. The file in question might be a primary database file or one of several temporary disk files. " Class { - #name : #SQLite3CantOpen, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3CantOpen', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3CantOpen class >> nativeErrorCode [ ^ SQLITE_CANTOPEN diff --git a/src/SQLite3-Core/SQLite3CantOpenConvertPath.class.st b/src/SQLite3-Core/SQLite3CantOpenConvertPath.class.st index 05e1b4b..97134d5 100644 --- a/src/SQLite3-Core/SQLite3CantOpenConvertPath.class.st +++ b/src/SQLite3-Core/SQLite3CantOpenConvertPath.class.st @@ -2,12 +2,14 @@ The SQLITE_CANTOPEN_CONVPATH error code is an extended error code for SQLITE_CANTOPEN used only by Cygwin VFS and indicating that the cygwin_conv_path() system call failed while trying to open a file. See also: SQLITE_IOERR_CONVPATH " Class { - #name : #SQLite3CantOpenConvertPath, - #superclass : #SQLite3CantOpen, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3CantOpenConvertPath', + #superclass : 'SQLite3CantOpen', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3CantOpenConvertPath class >> nativeErrorCode [ ^ SQLITE_CANTOPEN_CONVPATH diff --git a/src/SQLite3-Core/SQLite3CantOpenFullPath.class.st b/src/SQLite3-Core/SQLite3CantOpenFullPath.class.st index 602c16b..4994a2a 100644 --- a/src/SQLite3-Core/SQLite3CantOpenFullPath.class.st +++ b/src/SQLite3-Core/SQLite3CantOpenFullPath.class.st @@ -2,12 +2,14 @@ The SQLITE_CANTOPEN_FULLPATH error code is an extended error code for SQLITE_CANTOPEN indicating that a file open operation failed because the operating system was unable to convert the filename into a full pathname. " Class { - #name : #SQLite3CantOpenFullPath, - #superclass : #SQLite3CantOpen, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3CantOpenFullPath', + #superclass : 'SQLite3CantOpen', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3CantOpenFullPath class >> nativeErrorCode [ ^ SQLITE_CANTOPEN_FULLPATH diff --git a/src/SQLite3-Core/SQLite3CantOpenIsDir.class.st b/src/SQLite3-Core/SQLite3CantOpenIsDir.class.st index caf456c..fd3815c 100644 --- a/src/SQLite3-Core/SQLite3CantOpenIsDir.class.st +++ b/src/SQLite3-Core/SQLite3CantOpenIsDir.class.st @@ -2,12 +2,14 @@ The SQLITE_CANTOPEN_ISDIR error code is an extended error code for SQLITE_CANTOPEN indicating that a file open operation failed because the file is really a directory. " Class { - #name : #SQLite3CantOpenIsDir, - #superclass : #SQLite3CantOpen, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3CantOpenIsDir', + #superclass : 'SQLite3CantOpen', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3CantOpenIsDir class >> nativeErrorCode [ ^ SQLITE_CANTOPEN_ISDIR diff --git a/src/SQLite3-Core/SQLite3CantOpenNoTempDir.class.st b/src/SQLite3-Core/SQLite3CantOpenNoTempDir.class.st index 24ac603..94f325f 100644 --- a/src/SQLite3-Core/SQLite3CantOpenNoTempDir.class.st +++ b/src/SQLite3-Core/SQLite3CantOpenNoTempDir.class.st @@ -2,12 +2,14 @@ The SQLITE_CANTOPEN_NOTEMPDIR error code is no longer used. " Class { - #name : #SQLite3CantOpenNoTempDir, - #superclass : #SQLite3CantOpen, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3CantOpenNoTempDir', + #superclass : 'SQLite3CantOpen', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3CantOpenNoTempDir class >> nativeErrorCode [ ^ SQLITE_CANTOPEN_NOTEMPDIR diff --git a/src/SQLite3-Core/SQLite3Column.class.st b/src/SQLite3-Core/SQLite3Column.class.st index 4d5f837..f7d66cc 100644 --- a/src/SQLite3-Core/SQLite3Column.class.st +++ b/src/SQLite3-Core/SQLite3Column.class.st @@ -2,69 +2,71 @@ I represent a column in a table " Class { - #name : #SQLite3Column, - #superclass : #Object, + #name : 'SQLite3Column', + #superclass : 'Object', #instVars : [ 'name', 'index', 'type', 'hasNotNullConstraint' ], - #category : #'SQLite3-Core-Base' + #category : 'SQLite3-Core-Base', + #package : 'SQLite3-Core', + #tag : 'Base' } -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Column >> cid: anObject [ "The cid column should not be taken to mean more than 'rank within the current result set'." index := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Column >> hasNotNullConstraint [ ^ hasNotNullConstraint ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Column >> index [ ^ index ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Column >> index: anObject [ index := anObject ] -{ #category : #initialization } +{ #category : 'initialization' } SQLite3Column >> initialize [ super initialize. hasNotNullConstraint := false ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Column >> name [ ^ name ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Column >> name: anObject [ name := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Column >> notnull: anInteger [ "whether or not the column can be NULL" hasNotNullConstraint := anInteger = 1 ] -{ #category : #printing } +{ #category : 'printing' } SQLite3Column >> printOn: aStream [ super printOn: aStream. @@ -74,13 +76,13 @@ SQLite3Column >> printOn: aStream [ << '")' ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Column >> type [ ^ type ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Column >> type: anObject [ type := anObject diff --git a/src/SQLite3-Core/SQLite3Connection.class.st b/src/SQLite3-Core/SQLite3Connection.class.st index 94de600..5fdb3df 100644 --- a/src/SQLite3-Core/SQLite3Connection.class.st +++ b/src/SQLite3-Core/SQLite3Connection.class.st @@ -3,44 +3,46 @@ I represent a connection to an SQLite database. " Class { - #name : #SQLite3Connection, - #superclass : #SQLite3BaseConnection, - #category : #'SQLite3-Core-Connections' + #name : 'SQLite3Connection', + #superclass : 'SQLite3BaseConnection', + #category : 'SQLite3-Core-Connections', + #package : 'SQLite3-Core', + #tag : 'Connections' } -{ #category : #'public API - operating' } +{ #category : 'public API - operating' } SQLite3Connection >> execute: anSQLText [ ^ self execute: anSQLText with: #() ] -{ #category : #'public API - operating' } +{ #category : 'public API - operating' } SQLite3Connection >> execute: anSQLText value: anObject [ ^ (self prepare: anSQLText) execute: (Array with: anObject) ] -{ #category : #'public API - operating' } +{ #category : 'public API - operating' } SQLite3Connection >> execute: anSQLText value: object1 value: object2 [ ^ self execute: anSQLText with: (Array with: object1 with: object2) ] -{ #category : #'public API - operating' } +{ #category : 'public API - operating' } SQLite3Connection >> execute: anSQLText value: object1 value: object2 value: object3 [ ^ self execute: anSQLText with: (Array with: object1 with: object2 with: object3) ] -{ #category : #'public API - operating' } +{ #category : 'public API - operating' } SQLite3Connection >> execute: anSQLText value: object1 value: object2 value: object3 value: object4 [ ^ self execute: anSQLText with: (Array with: object1 with: object2 with: object3 with: object4) ] -{ #category : #'public API - operating' } +{ #category : 'public API - operating' } SQLite3Connection >> execute: anSQLText with: aCollection [ ^(self prepare: anSQLText) execute: aCollection ] -{ #category : #'public API - operating' } +{ #category : 'public API - operating' } SQLite3Connection >> execute: anSQLText with: aCollection doing: aBlock [ | cursor | cursor := self execute: anSQLText with: aCollection. @@ -48,7 +50,7 @@ SQLite3Connection >> execute: anSQLText with: aCollection doing: aBlock [ ensure: [ cursor finalizeStatement ] ] -{ #category : #'public API - operating' } +{ #category : 'public API - operating' } SQLite3Connection >> execute: anSQLText withAll: parameterCollection [ "execute a sql statement with many parameters" diff --git a/src/SQLite3-Core/SQLite3Constants.class.st b/src/SQLite3-Core/SQLite3Constants.class.st index 90992c5..9c03bfc 100644 --- a/src/SQLite3-Core/SQLite3Constants.class.st +++ b/src/SQLite3-Core/SQLite3Constants.class.st @@ -2,8 +2,8 @@ I provide SQLIte's constants. " Class { - #name : #SQLite3Constants, - #superclass : #SharedPool, + #name : 'SQLite3Constants', + #superclass : 'SharedPool', #classVars : [ 'SQLITE3_TEXT', 'SQLITE_ABORT', @@ -134,10 +134,12 @@ Class { 'SQLITE_WARNING', 'SQLITE_WARNING_AUTOINDEX' ], - #category : #'SQLite3-Core-UFFI-Support' + #category : 'SQLite3-Core-UFFI-Support', + #package : 'SQLite3-Core', + #tag : 'UFFI-Support' } -{ #category : #'private - initialization' } +{ #category : 'private - initialization' } SQLite3Constants class >> initCheckpointModes [ SQLITE_CHECKPOINT_PASSIVE := 0. @@ -146,7 +148,7 @@ SQLite3Constants class >> initCheckpointModes [ SQLITE_CHECKPOINT_TRUNCATE := 3 ] -{ #category : #'private - initialization' } +{ #category : 'private - initialization' } SQLite3Constants class >> initConstants [ self @@ -156,7 +158,7 @@ SQLite3Constants class >> initConstants [ initFileOpenFlags ] -{ #category : #'private - initialization' } +{ #category : 'private - initialization' } SQLite3Constants class >> initDataTypes [ "Fundamental Datatypes" @@ -168,7 +170,7 @@ SQLite3Constants class >> initDataTypes [ SQLITE_NULL := 5 ] -{ #category : #'private - initialization constants' } +{ #category : 'private - initialization constants' } SQLite3Constants class >> initErrorCodes [ "In its default configuration, SQLite API routines return one of 26 integer [SQLITE_OK | result codes]." @@ -203,7 +205,7 @@ SQLite3Constants class >> initErrorCodes [ SQLITE_WARNING := 28. "Warnings from sqlite3_log()" ] -{ #category : #'private - initialization constants' } +{ #category : 'private - initialization constants' } SQLite3Constants class >> initExtendedErrorCodes [ "Newer versions of SQLite (version 3.3.8 and later) include support for additional result codes that provide more detailed information about errors. The extended result codes are enabled or disabled on a per database connection basis using the [sqlite3_extended_result_codes()] API." @@ -276,7 +278,7 @@ SQLite3Constants class >> initExtendedErrorCodes [ SQLITE_OK_LOAD_PERMANENTLY := (SQLITE_OK | (1<<8)) ] -{ #category : #'private - initialization constants' } +{ #category : 'private - initialization constants' } SQLite3Constants class >> initFileOpenFlags [ SQLITE_OPEN_READONLY := Integer readFrom: '00000001' base: 16. " Ok for sqlite3_open_v2() " @@ -301,7 +303,7 @@ SQLite3Constants class >> initFileOpenFlags [ SQLITE_OPEN_WAL := Integer readFrom: '00080000' base: 16. " VFS only " ] -{ #category : #'private - initialization constants' } +{ #category : 'private - initialization constants' } SQLite3Constants class >> initResultCodes [ SQLITE_OK := 0. "Successful result" @@ -309,7 +311,7 @@ SQLite3Constants class >> initResultCodes [ SQLITE_DONE := 101 "sqlite3_step() has finished executing" ] -{ #category : #initialization } +{ #category : 'initialization' } SQLite3Constants class >> initialize [ self initConstants; diff --git a/src/SQLite3-Core/SQLite3ConstraintViolation.class.st b/src/SQLite3-Core/SQLite3ConstraintViolation.class.st index 2258c36..45c6516 100644 --- a/src/SQLite3-Core/SQLite3ConstraintViolation.class.st +++ b/src/SQLite3-Core/SQLite3ConstraintViolation.class.st @@ -4,12 +4,14 @@ The SQLITE_CONSTRAINT error code means that an SQL constraint violation occurred The SQLITE_CONSTRAINT code can also be used as the return value from the xBestIndex() method of a virtual table implementation. When xBestIndex() returns SQLITE_CONSTRAINT, that indicates that the particular combination of inputs submitted to xBestIndex() cannot result in a usable query plan and should not be given further consideration. " Class { - #name : #SQLite3ConstraintViolation, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3ConstraintViolation', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ConstraintViolation class >> nativeErrorCode [ ^ SQLITE_CONSTRAINT diff --git a/src/SQLite3-Core/SQLite3ConstraintViolationCheck.class.st b/src/SQLite3-Core/SQLite3ConstraintViolationCheck.class.st index 0805034..30b441f 100644 --- a/src/SQLite3-Core/SQLite3ConstraintViolationCheck.class.st +++ b/src/SQLite3-Core/SQLite3ConstraintViolationCheck.class.st @@ -2,12 +2,14 @@ The SQLITE_CONSTRAINT_CHECK error code is an extended error code for SQLITE_CONSTRAINT indicating that a CHECK constraint failed. " Class { - #name : #SQLite3ConstraintViolationCheck, - #superclass : #SQLite3ConstraintViolation, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3ConstraintViolationCheck', + #superclass : 'SQLite3ConstraintViolation', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ConstraintViolationCheck class >> nativeErrorCode [ ^ SQLITE_CONSTRAINT_CHECK diff --git a/src/SQLite3-Core/SQLite3ConstraintViolationCommitHook.class.st b/src/SQLite3-Core/SQLite3ConstraintViolationCommitHook.class.st index d899299..5e7a511 100644 --- a/src/SQLite3-Core/SQLite3ConstraintViolationCommitHook.class.st +++ b/src/SQLite3-Core/SQLite3ConstraintViolationCommitHook.class.st @@ -2,12 +2,14 @@ The SQLITE_CONSTRAINT_COMMITHOOK error code is an extended error code for SQLITE_CONSTRAINT indicating that a commit hook callback returned non-zero that thus caused the SQL statement to be rolled back. " Class { - #name : #SQLite3ConstraintViolationCommitHook, - #superclass : #SQLite3ConstraintViolation, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3ConstraintViolationCommitHook', + #superclass : 'SQLite3ConstraintViolation', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ConstraintViolationCommitHook class >> nativeErrorCode [ ^ SQLITE_CONSTRAINT_COMMITHOOK diff --git a/src/SQLite3-Core/SQLite3ConstraintViolationForeignKey.class.st b/src/SQLite3-Core/SQLite3ConstraintViolationForeignKey.class.st index eb8dde3..43c17e4 100644 --- a/src/SQLite3-Core/SQLite3ConstraintViolationForeignKey.class.st +++ b/src/SQLite3-Core/SQLite3ConstraintViolationForeignKey.class.st @@ -2,12 +2,14 @@ The SQLITE_CONSTRAINT_FOREIGNKEY error code is an extended error code for SQLITE_CONSTRAINT indicating that a foreign key constraint failed. " Class { - #name : #SQLite3ConstraintViolationForeignKey, - #superclass : #SQLite3ConstraintViolation, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3ConstraintViolationForeignKey', + #superclass : 'SQLite3ConstraintViolation', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ConstraintViolationForeignKey class >> nativeErrorCode [ ^ SQLITE_CONSTRAINT_FOREIGNKEY diff --git a/src/SQLite3-Core/SQLite3ConstraintViolationFunction.class.st b/src/SQLite3-Core/SQLite3ConstraintViolationFunction.class.st index f2d042a..52bb9bf 100644 --- a/src/SQLite3-Core/SQLite3ConstraintViolationFunction.class.st +++ b/src/SQLite3-Core/SQLite3ConstraintViolationFunction.class.st @@ -2,12 +2,14 @@ The SQLITE_CONSTRAINT_FUNCTION error code is not currently used by the SQLite core. However, this error code is available for use by extension functions. " Class { - #name : #SQLite3ConstraintViolationFunction, - #superclass : #SQLite3ConstraintViolation, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3ConstraintViolationFunction', + #superclass : 'SQLite3ConstraintViolation', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ConstraintViolationFunction class >> nativeErrorCode [ ^ SQLITE_CONSTRAINT_FUNCTION diff --git a/src/SQLite3-Core/SQLite3ConstraintViolationNotNull.class.st b/src/SQLite3-Core/SQLite3ConstraintViolationNotNull.class.st index a5838e4..dfb9922 100644 --- a/src/SQLite3-Core/SQLite3ConstraintViolationNotNull.class.st +++ b/src/SQLite3-Core/SQLite3ConstraintViolationNotNull.class.st @@ -2,12 +2,14 @@ The SQLITE_CONSTRAINT_NOTNULL error code is an extended error code for SQLITE_CONSTRAINT indicating that a NOT NULL constraint failed. " Class { - #name : #SQLite3ConstraintViolationNotNull, - #superclass : #SQLite3ConstraintViolation, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3ConstraintViolationNotNull', + #superclass : 'SQLite3ConstraintViolation', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ConstraintViolationNotNull class >> nativeErrorCode [ ^ SQLITE_CONSTRAINT_NOTNULL diff --git a/src/SQLite3-Core/SQLite3ConstraintViolationPrimaryKey.class.st b/src/SQLite3-Core/SQLite3ConstraintViolationPrimaryKey.class.st index ee58088..1a7ad7d 100644 --- a/src/SQLite3-Core/SQLite3ConstraintViolationPrimaryKey.class.st +++ b/src/SQLite3-Core/SQLite3ConstraintViolationPrimaryKey.class.st @@ -2,12 +2,14 @@ The SQLITE_CONSTRAINT_PRIMARYKEY error code is an extended error code for SQLITE_CONSTRAINT indicating that a PRIMARY KEY constraint failed. " Class { - #name : #SQLite3ConstraintViolationPrimaryKey, - #superclass : #SQLite3ConstraintViolation, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3ConstraintViolationPrimaryKey', + #superclass : 'SQLite3ConstraintViolation', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ConstraintViolationPrimaryKey class >> nativeErrorCode [ ^ SQLITE_CONSTRAINT_PRIMARYKEY diff --git a/src/SQLite3-Core/SQLite3ConstraintViolationRowID.class.st b/src/SQLite3-Core/SQLite3ConstraintViolationRowID.class.st index 31acb88..d0fbb9c 100644 --- a/src/SQLite3-Core/SQLite3ConstraintViolationRowID.class.st +++ b/src/SQLite3-Core/SQLite3ConstraintViolationRowID.class.st @@ -2,12 +2,14 @@ The SQLITE_CONSTRAINT_ROWID error code is an extended error code for SQLITE_CONSTRAINT indicating that a rowid is not unique. " Class { - #name : #SQLite3ConstraintViolationRowID, - #superclass : #SQLite3ConstraintViolation, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3ConstraintViolationRowID', + #superclass : 'SQLite3ConstraintViolation', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ConstraintViolationRowID class >> nativeErrorCode [ ^ SQLITE_CONSTRAINT_ROWID diff --git a/src/SQLite3-Core/SQLite3ConstraintViolationTrigger.class.st b/src/SQLite3-Core/SQLite3ConstraintViolationTrigger.class.st index ecd8026..e463e32 100644 --- a/src/SQLite3-Core/SQLite3ConstraintViolationTrigger.class.st +++ b/src/SQLite3-Core/SQLite3ConstraintViolationTrigger.class.st @@ -2,12 +2,14 @@ The SQLITE_CONSTRAINT_TRIGGER error code is an extended error code for SQLITE_CONSTRAINT indicating that a RAISE function within a trigger fired, causing the SQL statement to abort. " Class { - #name : #SQLite3ConstraintViolationTrigger, - #superclass : #SQLite3ConstraintViolation, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3ConstraintViolationTrigger', + #superclass : 'SQLite3ConstraintViolation', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ConstraintViolationTrigger class >> nativeErrorCode [ ^ SQLITE_CONSTRAINT_TRIGGER diff --git a/src/SQLite3-Core/SQLite3ConstraintViolationUnique.class.st b/src/SQLite3-Core/SQLite3ConstraintViolationUnique.class.st index c255983..12fd0e4 100644 --- a/src/SQLite3-Core/SQLite3ConstraintViolationUnique.class.st +++ b/src/SQLite3-Core/SQLite3ConstraintViolationUnique.class.st @@ -2,12 +2,14 @@ The SQLITE_CONSTRAINT_UNIQUE error code is an extended error code for SQLITE_CONSTRAINT indicating that a UNIQUE constraint failed. " Class { - #name : #SQLite3ConstraintViolationUnique, - #superclass : #SQLite3ConstraintViolation, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3ConstraintViolationUnique', + #superclass : 'SQLite3ConstraintViolation', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ConstraintViolationUnique class >> nativeErrorCode [ ^ SQLITE_CONSTRAINT_UNIQUE diff --git a/src/SQLite3-Core/SQLite3ConstraintViolationVirtualTable.class.st b/src/SQLite3-Core/SQLite3ConstraintViolationVirtualTable.class.st index 74a4771..8c4a477 100644 --- a/src/SQLite3-Core/SQLite3ConstraintViolationVirtualTable.class.st +++ b/src/SQLite3-Core/SQLite3ConstraintViolationVirtualTable.class.st @@ -2,12 +2,14 @@ The SQLITE_CONSTRAINT_VTAB error code is not currently used by the SQLite core. However, this error code is available for use by application-defined virtual tables. " Class { - #name : #SQLite3ConstraintViolationVirtualTable, - #superclass : #SQLite3ConstraintViolation, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3ConstraintViolationVirtualTable', + #superclass : 'SQLite3ConstraintViolation', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ConstraintViolationVirtualTable class >> nativeErrorCode [ ^ SQLITE_CONSTRAINT_VTAB diff --git a/src/SQLite3-Core/SQLite3Corrupt.class.st b/src/SQLite3-Core/SQLite3Corrupt.class.st index 1d57059..697a88f 100644 --- a/src/SQLite3-Core/SQLite3Corrupt.class.st +++ b/src/SQLite3-Core/SQLite3Corrupt.class.st @@ -4,12 +4,14 @@ This class comment was automatically generated from https://www.sqlite.org/resco The SQLITE_CORRUPT result code indicates that the database file has been corrupted. See the How To Corrupt Your Database Files for further discussion on how corruption can occur. " Class { - #name : #SQLite3Corrupt, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3Corrupt', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Corrupt class >> nativeErrorCode [ ^ SQLITE_CORRUPT diff --git a/src/SQLite3-Core/SQLite3CorruptVirtualTable.class.st b/src/SQLite3-Core/SQLite3CorruptVirtualTable.class.st index 6904e7e..8e00e04 100644 --- a/src/SQLite3-Core/SQLite3CorruptVirtualTable.class.st +++ b/src/SQLite3-Core/SQLite3CorruptVirtualTable.class.st @@ -2,12 +2,14 @@ The SQLITE_CORRUPT_VTAB error code is an extended error code for SQLITE_CORRUPT used by virtual tables. A virtual table might return SQLITE_CORRUPT_VTAB to indicate that content in the virtual table is corrupt. " Class { - #name : #SQLite3CorruptVirtualTable, - #superclass : #SQLite3Corrupt, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3CorruptVirtualTable', + #superclass : 'SQLite3Corrupt', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3CorruptVirtualTable class >> nativeErrorCode [ ^ SQLITE_CORRUPT_VTAB diff --git a/src/SQLite3-Core/SQLite3Cursor.class.st b/src/SQLite3-Core/SQLite3Cursor.class.st index 7d00cc3..bce4926 100644 --- a/src/SQLite3-Core/SQLite3Cursor.class.st +++ b/src/SQLite3-Core/SQLite3Cursor.class.st @@ -3,8 +3,8 @@ I represent a set of results returned by the database. I produce UDBCSQLite3Row " Class { - #name : #SQLite3Cursor, - #superclass : #Object, + #name : 'SQLite3Cursor', + #superclass : 'Object', #instVars : [ 'statement', 'moreRows', @@ -15,20 +15,22 @@ Class { #pools : [ 'SQLite3Constants' ], - #category : #'SQLite3-Core-Database' + #category : 'SQLite3-Core-Database', + #package : 'SQLite3-Core', + #tag : 'Database' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SQLite3Cursor class >> on: aStatement [ ^(self new) statement: aStatement; yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Cursor >> changes [ ^statement changes ] -{ #category : #API } +{ #category : 'API' } SQLite3Cursor >> close [ " closing a cursor is not the same as closing the statement - we may reuse a prepared statement" statement ifNotNil: [ statement reset ]. @@ -36,17 +38,17 @@ SQLite3Cursor >> close [ mutators := nil ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Cursor >> columnNames [ ^ statement ifNotNil: [ statement columnNames ] ifNil: [ #() ] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Cursor >> connection [ ^statement connection ] -{ #category : #enumerating } +{ #category : 'enumerating' } SQLite3Cursor >> do: aBlock [ "Evaluate aBlock with each of the receiver's rows as the argument." @@ -55,12 +57,12 @@ SQLite3Cursor >> do: aBlock [ aBlock value: eachRow ] ] -{ #category : #API } +{ #category : 'API' } SQLite3Cursor >> finalizeStatement [ statement finalize ] -{ #category : #initialization } +{ #category : 'initialization' } SQLite3Cursor >> initialize [ "Initializes the receiver" @@ -69,7 +71,7 @@ SQLite3Cursor >> initialize [ rowClass := SQLite3Row ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Cursor >> mutators [ ^ mutators ifNil: [ mutators := self columnNames @@ -78,12 +80,12 @@ SQLite3Cursor >> mutators [ joinUsing: '') uncapitalized asSymbol asMutator ] ] ] -{ #category : #API } +{ #category : 'API' } SQLite3Cursor >> next [ ^ self nextOfClass: self rowClass ] -{ #category : #API } +{ #category : 'API' } SQLite3Cursor >> nextOfClass: aRowClass [ | rr | moreRows ifFalse: [ ^nil ]. @@ -112,14 +114,14 @@ SQLite3Cursor >> nextOfClass: aRowClass [ ^ nil ] -{ #category : #API } +{ #category : 'API' } SQLite3Cursor >> onlyRow [ ^ self onlyRow: [ ] "For the common case where there is exactly one row expected. Returns nil if there is no row." ] -{ #category : #API } +{ #category : 'API' } SQLite3Cursor >> onlyRow: ifNoneBlock [ ^self rows ifEmpty: [ ifNoneBlock value ] @@ -128,27 +130,27 @@ SQLite3Cursor >> onlyRow: ifNoneBlock [ "For the common case where there is exactly one row expected. Returns the evaluation of ifNoneBlock if there is no row." ] -{ #category : #API } +{ #category : 'API' } SQLite3Cursor >> onlyValue [ ^(self onlyRow: []) ifNotNil: [ :r | r first ] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Cursor >> rowClass [ ^ rowClass ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Cursor >> rowClass: anObject [ rowClass := anObject ] -{ #category : #API } +{ #category : 'API' } SQLite3Cursor >> rows [ ^ self rowsOfClass: self rowClass ] -{ #category : #API } +{ #category : 'API' } SQLite3Cursor >> rowsOfClass: aRowClass [ rows ifNil: [ rows := OrderedCollection new ]. @@ -157,12 +159,12 @@ SQLite3Cursor >> rowsOfClass: aRowClass [ ^ rows ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Cursor >> statement [ ^ statement ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Cursor >> statement: anObject [ statement := anObject. moreRows := (statement ifNil:[false ] ifNotNil: [ statement dataValuesAvailable > 0 ]) diff --git a/src/SQLite3-Core/SQLite3Database.class.st b/src/SQLite3-Core/SQLite3Database.class.st index cce50ac..10a19e1 100644 --- a/src/SQLite3-Core/SQLite3Database.class.st +++ b/src/SQLite3-Core/SQLite3Database.class.st @@ -2,15 +2,17 @@ An SQLite3 database " Class { - #name : #SQLite3Database, - #superclass : #Object, + #name : 'SQLite3Database', + #superclass : 'Object', #instVars : [ 'connection' ], - #category : #'SQLite3-Core-Base' + #category : 'SQLite3-Core-Base', + #package : 'SQLite3-Core', + #tag : 'Base' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SQLite3Database class >> forConnection: aConnection [ ^ self new @@ -18,19 +20,19 @@ SQLite3Database class >> forConnection: aConnection [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SQLite3Database class >> memory [ ^ self forConnection: SQLite3Connection memory ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SQLite3Database class >> on: aFilename [ ^ self forConnection: (SQLite3Connection on: aFilename) ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SQLite3Database class >> openOn: aFilename [ ^ (self on: aFilename) @@ -38,52 +40,43 @@ SQLite3Database class >> openOn: aFilename [ yourself ] -{ #category : #accessing } -SQLite3Database class >> tableInfoFor: aFileName [ - - | db | - db := self on: aFileName. - db connection open. - ^ db tables -] - -{ #category : #'open/close' } +{ #category : 'open/close' } SQLite3Database >> close [ ^ self connection close ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Database >> connection [ ^ connection ] -{ #category : #executing } +{ #category : 'executing' } SQLite3Database >> execute: anSQLStatement [ ^ self connection execute: anSQLStatement ] -{ #category : #executing } +{ #category : 'executing' } SQLite3Database >> execute: anSQLStatement doing: aBlock [ ^ self connection execute: anSQLStatement with: #( ) doing: aBlock ] -{ #category : #'private - initialization' } +{ #category : 'private - initialization' } SQLite3Database >> initConnection: aConnection [ connection := aConnection ] -{ #category : #'open/close' } +{ #category : 'open/close' } SQLite3Database >> open [ ^ self connection open ] -{ #category : #printing } +{ #category : 'printing' } SQLite3Database >> printOn: aStream [ super printOn: aStream. @@ -93,7 +86,7 @@ SQLite3Database >> printOn: aStream [ << '")' ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Database >> tables [ self connection isOpen ifFalse: [ ^ SQLite3NotOpen signal ]. diff --git a/src/SQLite3-Core/SQLite3DatabaseExternalObject.class.st b/src/SQLite3-Core/SQLite3DatabaseExternalObject.class.st index 3971c0f..2b803b4 100644 --- a/src/SQLite3-Core/SQLite3DatabaseExternalObject.class.st +++ b/src/SQLite3-Core/SQLite3DatabaseExternalObject.class.st @@ -2,26 +2,28 @@ I represent the SQLite API 'sqlite3' C-level type. " Class { - #name : #SQLite3DatabaseExternalObject, - #superclass : #FFIOpaqueObject, - #category : #'SQLite3-Core-UFFI-Support' + #name : 'SQLite3DatabaseExternalObject', + #superclass : 'FFIOpaqueObject', + #category : 'SQLite3-Core-UFFI-Support', + #package : 'SQLite3-Core', + #tag : 'UFFI-Support' } -{ #category : #'instance finalization' } +{ #category : 'instance finalization' } SQLite3DatabaseExternalObject class >> doFinalizeResourceData: resourceData [ SQLite3Library current ffiCall: #( int sqlite3_close_v2 #( void * resourceData ) ) ] -{ #category : #finalization } +{ #category : 'finalization' } SQLite3DatabaseExternalObject class >> finalizeResourceData: aHandle [ self doFinalizeResourceData: aHandle. aHandle beNull ] -{ #category : #initialization } +{ #category : 'initialization' } SQLite3DatabaseExternalObject >> beNull [ ^ handle beNull diff --git a/src/SQLite3-Core/SQLite3DoneResult.class.st b/src/SQLite3-Core/SQLite3DoneResult.class.st index c07d82a..45972bc 100644 --- a/src/SQLite3-Core/SQLite3DoneResult.class.st +++ b/src/SQLite3-Core/SQLite3DoneResult.class.st @@ -2,12 +2,14 @@ The SQLITE_DONE result code indicates that an operation has completed. The SQLITE_DONE result code is most commonly seen as a return value from sqlite3_step() indicating that the SQL statement has run to completion. But SQLITE_DONE can also be returned by other multi-step interfaces such as sqlite3_backup_step(). " Class { - #name : #SQLite3DoneResult, - #superclass : #SQLite3Result, - #category : #'SQLite3-Core-Results' + #name : 'SQLite3DoneResult', + #superclass : 'SQLite3Result', + #category : 'SQLite3-Core-Results', + #package : 'SQLite3-Core', + #tag : 'Results' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3DoneResult class >> nativeResultCode [ ^ SQLITE_DONE diff --git a/src/SQLite3-Core/SQLite3Empty.class.st b/src/SQLite3-Core/SQLite3Empty.class.st index 281309c..4294175 100644 --- a/src/SQLite3-Core/SQLite3Empty.class.st +++ b/src/SQLite3-Core/SQLite3Empty.class.st @@ -4,12 +4,14 @@ This class comment was automatically generated from https://www.sqlite.org/resco The SQLITE_EMPTY result code is not currently used. " Class { - #name : #SQLite3Empty, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3Empty', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Empty class >> nativeErrorCode [ ^ SQLITE_EMPTY diff --git a/src/SQLite3-Core/SQLite3Error.class.st b/src/SQLite3-Core/SQLite3Error.class.st index fb9c7e2..3e7b9cd 100644 --- a/src/SQLite3-Core/SQLite3Error.class.st +++ b/src/SQLite3-Core/SQLite3Error.class.st @@ -4,12 +4,14 @@ This class comment was automatically generated from https://www.sqlite.org/resco The SQLITE_ERROR result code is a generic error code that is used when no other more specific error code is available. " Class { - #name : #SQLite3Error, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3Error', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Error class >> nativeErrorCode [ ^ SQLITE_ERROR diff --git a/src/SQLite3-Core/SQLite3Format.class.st b/src/SQLite3-Core/SQLite3Format.class.st index 4e7425e..1fbb676 100644 --- a/src/SQLite3-Core/SQLite3Format.class.st +++ b/src/SQLite3-Core/SQLite3Format.class.st @@ -4,12 +4,14 @@ This class comment was automatically generated from https://www.sqlite.org/resco The SQLITE_FORMAT result code is not currently used. " Class { - #name : #SQLite3Format, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3Format', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Format class >> nativeErrorCode [ ^ SQLITE_FORMAT diff --git a/src/SQLite3-Core/SQLite3Full.class.st b/src/SQLite3-Core/SQLite3Full.class.st index f872d76..1b5a384 100644 --- a/src/SQLite3-Core/SQLite3Full.class.st +++ b/src/SQLite3-Core/SQLite3Full.class.st @@ -6,12 +6,14 @@ The SQLITE_FULL result code indicates that a write could not complete because th Sometimes applications encounter this error even though there is an abundance of primary disk space because the error occurs when writing into temporary disk files on a system where temporary files are stored on a separate partition with much less space that the primary disk. " Class { - #name : #SQLite3Full, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3Full', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Full class >> nativeErrorCode [ ^ SQLITE_FULL diff --git a/src/SQLite3-Core/SQLite3IOError.class.st b/src/SQLite3-Core/SQLite3IOError.class.st index 97059b1..64d6d87 100644 --- a/src/SQLite3-Core/SQLite3IOError.class.st +++ b/src/SQLite3-Core/SQLite3IOError.class.st @@ -6,12 +6,14 @@ A full disk drive will normally give an SQLITE_FULL error rather than an SQLITE_ There are many different extended result codes for I/O errors that identify the specific I/O operation that failed. " Class { - #name : #SQLite3IOError, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3IOError', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOError class >> nativeErrorCode [ ^ SQLITE_IOERR diff --git a/src/SQLite3-Core/SQLite3IOErrorAccess.class.st b/src/SQLite3-Core/SQLite3IOErrorAccess.class.st index 7e4d46b..295abeb 100644 --- a/src/SQLite3-Core/SQLite3IOErrorAccess.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorAccess.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_ACCESS error code is an extended error code for SQLITE_IOERR indicating an I/O error within the xAccess method on the sqlite3_vfs object. " Class { - #name : #SQLite3IOErrorAccess, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorAccess', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorAccess class >> nativeErrorCode [ ^ SQLITE_IOERR_ACCESS diff --git a/src/SQLite3-Core/SQLite3IOErrorBlocked.class.st b/src/SQLite3-Core/SQLite3IOErrorBlocked.class.st index 5ed2495..75dca11 100644 --- a/src/SQLite3-Core/SQLite3IOErrorBlocked.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorBlocked.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_BLOCKED error code is no longer used. " Class { - #name : #SQLite3IOErrorBlocked, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorBlocked', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorBlocked class >> nativeErrorCode [ ^ SQLITE_IOERR_BLOCKED diff --git a/src/SQLite3-Core/SQLite3IOErrorCheckReservedLock.class.st b/src/SQLite3-Core/SQLite3IOErrorCheckReservedLock.class.st index 95ae06d..34ff89c 100644 --- a/src/SQLite3-Core/SQLite3IOErrorCheckReservedLock.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorCheckReservedLock.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_CHECKRESERVEDLOCK error code is an extended error code for SQLITE_IOERR indicating an I/O error within the xCheckReservedLock method on the sqlite3_io_methods object. " Class { - #name : #SQLite3IOErrorCheckReservedLock, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorCheckReservedLock', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorCheckReservedLock class >> nativeErrorCode [ ^ SQLITE_IOERR_CHECKRESERVEDLOCK diff --git a/src/SQLite3-Core/SQLite3IOErrorClose.class.st b/src/SQLite3-Core/SQLite3IOErrorClose.class.st index 59daa14..12ae2f4 100644 --- a/src/SQLite3-Core/SQLite3IOErrorClose.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorClose.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_CLOSE error code is an extended error code for SQLITE_IOERR indicating an I/O error within the xClose method on the sqlite3_io_methods object. " Class { - #name : #SQLite3IOErrorClose, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorClose', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorClose class >> nativeErrorCode [ ^ SQLITE_IOERR_CLOSE diff --git a/src/SQLite3-Core/SQLite3IOErrorConvertPath.class.st b/src/SQLite3-Core/SQLite3IOErrorConvertPath.class.st index 750665e..1fcef45 100644 --- a/src/SQLite3-Core/SQLite3IOErrorConvertPath.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorConvertPath.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_CONVPATH error code is an extended error code for SQLITE_IOERR used only by Cygwin VFS and indicating that the cygwin_conv_path() system call failed. See also: SQLITE_CANTOPEN_CONVPATH " Class { - #name : #SQLite3IOErrorConvertPath, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorConvertPath', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorConvertPath class >> nativeErrorCode [ ^ SQLITE_IOERR_CONVPATH diff --git a/src/SQLite3-Core/SQLite3IOErrorDelete.class.st b/src/SQLite3-Core/SQLite3IOErrorDelete.class.st index 58176b8..0633a81 100644 --- a/src/SQLite3-Core/SQLite3IOErrorDelete.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorDelete.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_DELETE error code is an extended error code for SQLITE_IOERR indicating an I/O error within xDelete method on the sqlite3_vfs object. " Class { - #name : #SQLite3IOErrorDelete, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorDelete', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorDelete class >> nativeErrorCode [ ^ SQLITE_IOERR_DELETE diff --git a/src/SQLite3-Core/SQLite3IOErrorDeleteNoEntry.class.st b/src/SQLite3-Core/SQLite3IOErrorDeleteNoEntry.class.st index 8a85d5b..969fcfc 100644 --- a/src/SQLite3-Core/SQLite3IOErrorDeleteNoEntry.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorDeleteNoEntry.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_DELETE_NOENT error code is an extended error code for SQLITE_IOERR indicating that the xDelete method on the sqlite3_vfs object failed because the file being deleted does not exist. " Class { - #name : #SQLite3IOErrorDeleteNoEntry, - #superclass : #SQLite3IOErrorDelete, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorDeleteNoEntry', + #superclass : 'SQLite3IOErrorDelete', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorDeleteNoEntry class >> nativeErrorCode [ ^ SQLITE_IOERR_DELETE_NOENT diff --git a/src/SQLite3-Core/SQLite3IOErrorDirClose.class.st b/src/SQLite3-Core/SQLite3IOErrorDirClose.class.st index 792d0bf..05dfc7f 100644 --- a/src/SQLite3-Core/SQLite3IOErrorDirClose.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorDirClose.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_DIR_CLOSE error code is no longer used. " Class { - #name : #SQLite3IOErrorDirClose, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorDirClose', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorDirClose class >> nativeErrorCode [ ^ SQLITE_IOERR_DIR_CLOSE diff --git a/src/SQLite3-Core/SQLite3IOErrorDirFSync.class.st b/src/SQLite3-Core/SQLite3IOErrorDirFSync.class.st index 51b0617..6ad6c8d 100644 --- a/src/SQLite3-Core/SQLite3IOErrorDirFSync.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorDirFSync.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_DIR_FSYNC error code is an extended error code for SQLITE_IOERR indicating an I/O error in the VFS layer while trying to invoke fsync() on a directory. The unix VFS attempts to fsync() directories after creating or deleting certain files to ensure that those files will still appear in the filesystem following a power loss or system crash. This error code indicates a problem attempting to perform that fsync(). " Class { - #name : #SQLite3IOErrorDirFSync, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorDirFSync', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorDirFSync class >> nativeErrorCode [ ^ SQLITE_IOERR_DIR_FSYNC diff --git a/src/SQLite3-Core/SQLite3IOErrorFStat.class.st b/src/SQLite3-Core/SQLite3IOErrorFStat.class.st index ce0b133..61ed9f6 100644 --- a/src/SQLite3-Core/SQLite3IOErrorFStat.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorFStat.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_FSTAT error code is an extended error code for SQLITE_IOERR indicating an I/O error in the VFS layer while trying to invoke fstat() (or the equivalent) on a file in order to determine information such as the file size or access permissions. " Class { - #name : #SQLite3IOErrorFStat, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorFStat', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorFStat class >> nativeErrorCode [ ^ SQLITE_IOERR_FSTAT diff --git a/src/SQLite3-Core/SQLite3IOErrorFSync.class.st b/src/SQLite3-Core/SQLite3IOErrorFSync.class.st index af1ce1b..1f19508 100644 --- a/src/SQLite3-Core/SQLite3IOErrorFSync.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorFSync.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_FSYNC error code is an extended error code for SQLITE_IOERR indicating an I/O error in the VFS layer while trying to flush previously written content out of OS and/or disk-control buffers and into persistent storage. In other words, this code indicates a problem with the fsync() system call in unix or the FlushFileBuffers() system call in windows. " Class { - #name : #SQLite3IOErrorFSync, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorFSync', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorFSync class >> nativeErrorCode [ ^ SQLITE_IOERR_FSYNC diff --git a/src/SQLite3-Core/SQLite3IOErrorGetTempPath.class.st b/src/SQLite3-Core/SQLite3IOErrorGetTempPath.class.st index 75f422f..df9a3af 100644 --- a/src/SQLite3-Core/SQLite3IOErrorGetTempPath.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorGetTempPath.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_GETTEMPPATH error code is an extended error code for SQLITE_IOERR indicating that the VFS is unable to determine a suitable directory in which to place temporary files. " Class { - #name : #SQLite3IOErrorGetTempPath, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorGetTempPath', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorGetTempPath class >> nativeErrorCode [ ^ SQLITE_IOERR_GETTEMPPATH diff --git a/src/SQLite3-Core/SQLite3IOErrorLock.class.st b/src/SQLite3-Core/SQLite3IOErrorLock.class.st index 0350084..975d44f 100644 --- a/src/SQLite3-Core/SQLite3IOErrorLock.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorLock.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_LOCK error code is an extended error code for SQLITE_IOERR indicating an I/O error in the advisory file locking logic. Usually an SQLITE_IOERR_LOCK error indicates a problem obtaining a PENDING lock. However it can also indicate miscellaneous locking errors on some of the specialized VFSes used on Macs. " Class { - #name : #SQLite3IOErrorLock, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorLock', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorLock class >> nativeErrorCode [ ^ SQLITE_IOERR_LOCK diff --git a/src/SQLite3-Core/SQLite3IOErrorMemoryMap.class.st b/src/SQLite3-Core/SQLite3IOErrorMemoryMap.class.st index e6ed46b..92a20d1 100644 --- a/src/SQLite3-Core/SQLite3IOErrorMemoryMap.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorMemoryMap.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_MMAP error code is an extended error code for SQLITE_IOERR indicating an I/O error within the xFetch or xUnfetch methods on the sqlite3_io_methods object while trying to map or unmap part of the database file into the process address space. " Class { - #name : #SQLite3IOErrorMemoryMap, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorMemoryMap', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorMemoryMap class >> nativeErrorCode [ ^ SQLITE_IOERR_MMAP diff --git a/src/SQLite3-Core/SQLite3IOErrorNoMemory.class.st b/src/SQLite3-Core/SQLite3IOErrorNoMemory.class.st index 8f50bea..fd4c8c2 100644 --- a/src/SQLite3-Core/SQLite3IOErrorNoMemory.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorNoMemory.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_NOMEM error code is sometimes returned by the VFS layer to indicate that an operation could not be completed due to the inability to allocate sufficient memory. This error code is normally converted into SQLITE_NOMEM by the higher layers of SQLite before being returned to the application. " Class { - #name : #SQLite3IOErrorNoMemory, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorNoMemory', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorNoMemory class >> nativeErrorCode [ ^ SQLITE_IOERR_NOMEM diff --git a/src/SQLite3-Core/SQLite3IOErrorRead.class.st b/src/SQLite3-Core/SQLite3IOErrorRead.class.st index dcb6245..4b2ec10 100644 --- a/src/SQLite3-Core/SQLite3IOErrorRead.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorRead.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_READ error code is an extended error code for SQLITE_IOERR indicating an I/O error in the VFS layer while trying to read from a file on disk. This error might result from a hardware malfunction or because a filesystem came unmounted while the file was open. " Class { - #name : #SQLite3IOErrorRead, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorRead', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorRead class >> nativeErrorCode [ ^ SQLITE_IOERR_READ diff --git a/src/SQLite3-Core/SQLite3IOErrorReadLock.class.st b/src/SQLite3-Core/SQLite3IOErrorReadLock.class.st index 5d83b91..11ec54b 100644 --- a/src/SQLite3-Core/SQLite3IOErrorReadLock.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorReadLock.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_RDLOCK error code is an extended error code for SQLITE_IOERR indicating an I/O error within xLock method on the sqlite3_io_methods object while trying to obtain a read lock. " Class { - #name : #SQLite3IOErrorReadLock, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorReadLock', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorReadLock class >> nativeErrorCode [ ^ SQLITE_IOERR_RDLOCK diff --git a/src/SQLite3-Core/SQLite3IOErrorSeek.class.st b/src/SQLite3-Core/SQLite3IOErrorSeek.class.st index a6bf0b6..22e0893 100644 --- a/src/SQLite3-Core/SQLite3IOErrorSeek.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorSeek.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_SEEK error code is an extended error code for SQLITE_IOERR indicating an I/O error within the xRead or xWrite methods on the sqlite3_io_methods object while trying to seek a file descriptor to the beginning point of the file where the read or write is to occur. " Class { - #name : #SQLite3IOErrorSeek, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorSeek', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorSeek class >> nativeErrorCode [ ^ SQLITE_IOERR_SEEK diff --git a/src/SQLite3-Core/SQLite3IOErrorSharedMemoryError.class.st b/src/SQLite3-Core/SQLite3IOErrorSharedMemoryError.class.st index 3d90dc6..1e1e9e5 100644 --- a/src/SQLite3-Core/SQLite3IOErrorSharedMemoryError.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorSharedMemoryError.class.st @@ -2,12 +2,14 @@ Abstract superclass for extended errors on shared memory access in SQlite3 " Class { - #name : #SQLite3IOErrorSharedMemoryError, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorSharedMemoryError', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #testing } +{ #category : 'testing' } SQLite3IOErrorSharedMemoryError class >> isAbstract [ ^self name = #SQLite3IOErrorSharedMemoryError diff --git a/src/SQLite3-Core/SQLite3IOErrorSharedMemoryLock.class.st b/src/SQLite3-Core/SQLite3IOErrorSharedMemoryLock.class.st index 1932d05..7097db0 100644 --- a/src/SQLite3-Core/SQLite3IOErrorSharedMemoryLock.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorSharedMemoryLock.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_SHMLOCK error code is no longer used. " Class { - #name : #SQLite3IOErrorSharedMemoryLock, - #superclass : #SQLite3IOErrorSharedMemoryError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorSharedMemoryLock', + #superclass : 'SQLite3IOErrorSharedMemoryError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorSharedMemoryLock class >> nativeErrorCode [ ^ SQLITE_IOERR_SHMLOCK diff --git a/src/SQLite3-Core/SQLite3IOErrorSharedMemoryMap.class.st b/src/SQLite3-Core/SQLite3IOErrorSharedMemoryMap.class.st index 11fdbaf..5be634f 100644 --- a/src/SQLite3-Core/SQLite3IOErrorSharedMemoryMap.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorSharedMemoryMap.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_SHMMAP error code is an extended error code for SQLITE_IOERR indicating an I/O error within the xShmMap method on the sqlite3_io_methods object while trying to map a shared memory segment into the process address space. " Class { - #name : #SQLite3IOErrorSharedMemoryMap, - #superclass : #SQLite3IOErrorSharedMemoryError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorSharedMemoryMap', + #superclass : 'SQLite3IOErrorSharedMemoryError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorSharedMemoryMap class >> nativeErrorCode [ ^ SQLITE_IOERR_SHMMAP diff --git a/src/SQLite3-Core/SQLite3IOErrorSharedMemoryOpen.class.st b/src/SQLite3-Core/SQLite3IOErrorSharedMemoryOpen.class.st index fe596fa..c4bf38a 100644 --- a/src/SQLite3-Core/SQLite3IOErrorSharedMemoryOpen.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorSharedMemoryOpen.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_SHMOPEN error code is an extended error code for SQLITE_IOERR indicating an I/O error within the xShmMap method on the sqlite3_io_methods object while trying to open a new shared memory segment. " Class { - #name : #SQLite3IOErrorSharedMemoryOpen, - #superclass : #SQLite3IOErrorSharedMemoryError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorSharedMemoryOpen', + #superclass : 'SQLite3IOErrorSharedMemoryError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorSharedMemoryOpen class >> nativeErrorCode [ ^ SQLITE_IOERR_SHMOPEN diff --git a/src/SQLite3-Core/SQLite3IOErrorSharedMemorySize.class.st b/src/SQLite3-Core/SQLite3IOErrorSharedMemorySize.class.st index 813f0dd..87ca2f3 100644 --- a/src/SQLite3-Core/SQLite3IOErrorSharedMemorySize.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorSharedMemorySize.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_SHMSIZE error code is an extended error code for SQLITE_IOERR indicating an I/O error within the xShmMap method on the sqlite3_io_methods object while trying to enlarge a ""shm"" file as part of WAL mode transaction processing. This error may indicate that the underlying filesystem volume is out of space. " Class { - #name : #SQLite3IOErrorSharedMemorySize, - #superclass : #SQLite3IOErrorSharedMemoryError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorSharedMemorySize', + #superclass : 'SQLite3IOErrorSharedMemoryError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorSharedMemorySize class >> nativeErrorCode [ ^ SQLITE_IOERR_SHMSIZE diff --git a/src/SQLite3-Core/SQLite3IOErrorShortRead.class.st b/src/SQLite3-Core/SQLite3IOErrorShortRead.class.st index 4d87725..269ec0a 100644 --- a/src/SQLite3-Core/SQLite3IOErrorShortRead.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorShortRead.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_SHORT_READ error code is an extended error code for SQLITE_IOERR indicating that a read attempt in the VFS layer was unable to obtain as many bytes as was requested. This might be due to a truncated file. " Class { - #name : #SQLite3IOErrorShortRead, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorShortRead', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorShortRead class >> nativeErrorCode [ ^ SQLITE_IOERR_SHORT_READ diff --git a/src/SQLite3-Core/SQLite3IOErrorTruncate.class.st b/src/SQLite3-Core/SQLite3IOErrorTruncate.class.st index e9f7652..3d9a907 100644 --- a/src/SQLite3-Core/SQLite3IOErrorTruncate.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorTruncate.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_TRUNCATE error code is an extended error code for SQLITE_IOERR indicating an I/O error in the VFS layer while trying to truncate a file to a smaller size. " Class { - #name : #SQLite3IOErrorTruncate, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorTruncate', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorTruncate class >> nativeErrorCode [ ^ SQLITE_IOERR_TRUNCATE diff --git a/src/SQLite3-Core/SQLite3IOErrorUnlock.class.st b/src/SQLite3-Core/SQLite3IOErrorUnlock.class.st index 0495c5e..16567a5 100644 --- a/src/SQLite3-Core/SQLite3IOErrorUnlock.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorUnlock.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_UNLOCK error code is an extended error code for SQLITE_IOERR indicating an I/O error within xUnlock method on the sqlite3_io_methods object. " Class { - #name : #SQLite3IOErrorUnlock, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorUnlock', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorUnlock class >> nativeErrorCode [ ^ SQLITE_IOERR_UNLOCK diff --git a/src/SQLite3-Core/SQLite3IOErrorWrite.class.st b/src/SQLite3-Core/SQLite3IOErrorWrite.class.st index 2000533..1fcbd33 100644 --- a/src/SQLite3-Core/SQLite3IOErrorWrite.class.st +++ b/src/SQLite3-Core/SQLite3IOErrorWrite.class.st @@ -2,12 +2,14 @@ The SQLITE_IOERR_WRITE error code is an extended error code for SQLITE_IOERR indicating an I/O error in the VFS layer while trying to write into a file on disk. This error might result from a hardware malfunction or because a filesystem came unmounted while the file was open. This error should not occur if the filesystem is full as there is a separate error code (SQLITE_FULL) for that purpose. " Class { - #name : #SQLite3IOErrorWrite, - #superclass : #SQLite3IOError, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3IOErrorWrite', + #superclass : 'SQLite3IOError', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3IOErrorWrite class >> nativeErrorCode [ ^ SQLITE_IOERR_WRITE diff --git a/src/SQLite3-Core/SQLite3Internal.class.st b/src/SQLite3-Core/SQLite3Internal.class.st index 49919f0..451d4fe 100644 --- a/src/SQLite3-Core/SQLite3Internal.class.st +++ b/src/SQLite3-Core/SQLite3Internal.class.st @@ -4,12 +4,14 @@ The SQLITE_INTERNAL result code indicates an internal malfunction. In a working SQLite does not currently generate this result code. However, application-defined SQL functions or virtual tables, or VFSes, or other extensions might cause this result code to be returned. " Class { - #name : #SQLite3Internal, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3Internal', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Internal class >> nativeErrorCode [ ^ SQLITE_INTERNAL diff --git a/src/SQLite3-Core/SQLite3Interrupt.class.st b/src/SQLite3-Core/SQLite3Interrupt.class.st index 48d0e64..15dab58 100644 --- a/src/SQLite3-Core/SQLite3Interrupt.class.st +++ b/src/SQLite3-Core/SQLite3Interrupt.class.st @@ -2,12 +2,14 @@ The SQLITE_INTERRUPT result code indicates that an operation was interrupted by the sqlite3_interrupt() interface. See also: SQLITE_ABORT " Class { - #name : #SQLite3Interrupt, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3Interrupt', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Interrupt class >> nativeErrorCode [ ^ SQLITE_INTERRUPT diff --git a/src/SQLite3-Core/SQLite3Library.class.st b/src/SQLite3-Core/SQLite3Library.class.st index a200d4a..221e6b0 100644 --- a/src/SQLite3-Core/SQLite3Library.class.st +++ b/src/SQLite3-Core/SQLite3Library.class.st @@ -2,8 +2,8 @@ I am the (unified) FFI interface to SQLite. " Class { - #name : #SQLite3Library, - #superclass : #FFILibrary, + #name : 'SQLite3Library', + #superclass : 'FFILibrary', #classVars : [ 'DataTypeMap', 'DateTimeTypeMap', @@ -12,36 +12,38 @@ Class { #pools : [ 'SQLite3Constants' ], - #category : #'SQLite3-Core-UFFI' + #category : 'SQLite3-Core-UFFI', + #package : 'SQLite3-Core', + #tag : 'UFFI' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Library class >> booleanSQLFalseWords [ ^ #('false' 'f') ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Library class >> booleanSQLTrueWords [ ^ #('true' 't') ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Library class >> booleanTypes [ ^ #('boolean' 'bool') ] -{ #category : #factory } +{ #category : 'factory' } SQLite3Library class >> current [ ^self uniqueInstance ] -{ #category : #'unified FFI - binding' } +{ #category : 'unified FFI - binding' } SQLite3Library class >> ffiBindingOf: aTypeName [ ^ TypeMap at: aTypeName ifAbsent: [ super ffiBindingOf: aTypeName ] ] -{ #category : #'class initialization' } +{ #category : 'class initialization' } SQLite3Library class >> initialize [ self @@ -50,7 +52,7 @@ SQLite3Library class >> initialize [ initializeDateTimeTypeMap ] -{ #category : #'private - initialization' } +{ #category : 'private - initialization' } SQLite3Library class >> initializeDataTypeMap [ DataTypeMap := Dictionary newFromPairs: #( @@ -62,7 +64,7 @@ SQLite3Library class >> initializeDataTypeMap [ ) ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Library class >> initializeDateTimeTypeMap [ DateTimeTypeMap := { 'datetime' -> #dateTimeAt:. @@ -71,7 +73,7 @@ SQLite3Library class >> initializeDateTimeTypeMap [ 'time' -> #timeAt: } asDictionary ] -{ #category : #'private - initialization' } +{ #category : 'private - initialization' } SQLite3Library class >> initializeTypeMap [ TypeMap := Dictionary newFromPairs: #( @@ -83,40 +85,40 @@ SQLite3Library class >> initializeTypeMap [ ) ] -{ #category : #factory } +{ #category : 'factory' } SQLite3Library class >> reset [ uniqueInstance := nil ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiBackupFinish: backupHandle [ "int sqlite3_backup_finish(sqlite3_backup *p)" ^ self ffiCall: #(int sqlite3_backup_finish(SQLite3BackupExternalReference *backupHandle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiBackupPageCount: backupHandle [ "int sqlite3_backup_pagecount(sqlite3_backup *p)" ^ self ffiCall: #(int sqlite3_backup_pagecount(sqlite3_backup *backupHandle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiBackupRemaining: backupHandle [ "int sqlite3_backup_remaining(sqlite3_backup *p)" ^ self ffiCall: #(int sqlite3_backup_remaining(sqlite3_backup *backupHandle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiBackupStep:nPage via: backupHandle [ "int sqlite3_backup_step(sqlite3_backup *p, int nPage)" ^ self ffiCall: #(int sqlite3_backup_step(SQLite3BackupExternalReference *backupHandle, int nPage)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiBackupTo: pDest named: zDestName from: pSource named: zSourceName [ "sqlite3_backup *sqlite3_backup_init( sqlite3 *pDest, /* Destination database handle */ @@ -129,21 +131,21 @@ SQLite3Library >> apiBackupTo: pDest named: zDestName from: pSource named: zSour sqlite3 *pDest, String zDestName, sqlite3 *pSource, String zSourceName)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiBindBlob: aStatement atColumn: aColumn with: aByteArray with: anInteger with: aPointer [ "int sqlite3_bind_blob(sqlite3_stmt*, int, const void *, int, void(*)(void*))" ^ self ffiCall: #(int sqlite3_bind_blob (sqlite3_stmt* aStatement, int aColumn, void* aByteArray, int anInteger, int aPointer)) "SQLITE_TRANSIENT" ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiBindDouble: aStatement atColumn: aColumn with: aFloat [ "int sqlite3_bind_double(sqlite3_stmt*, int, double)" ^ self ffiCall: #(int sqlite3_bind_double (sqlite3_stmt* aStatement, int aColumn, double aFloat)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiBindInteger: aStatement atColumn: aColumn with: anInteger [ "int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite_int64)" @@ -151,77 +153,77 @@ SQLite3Library >> apiBindInteger: aStatement atColumn: aColumn with: anInteger [ ffiCall: #(int sqlite3_bind_int64 (sqlite3_stmt* aStatement,int aColumn,sqlite3_int64 anInteger)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiBindNull: aStatement atColumn: aColumn [ "int sqlite3_bind_null(sqlite3_stmt*, int)" ^ self ffiCall: #(int sqlite3_bind_null (sqlite3_stmt* aStatement, int aColumn)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiBindParameterCount: aStatement [ "int sqlite3_bind_parameter_count(sqlite3_stmt*)" ^ self ffiCall: #(int sqlite3_bind_parameter_count (sqlite3_stmt* aStatement)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiBindParameterIndex: aStatement for: aName [ "int sqlite3_bind_parameter_index(sqlite3_stmt*, const char* zName)" ^ self ffiCall: #(int sqlite3_bind_parameter_index (sqlite3_stmt* aStatement, String aName)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiBindText: aStatement atColumn: aColumn with: aString with: anInteger with: anotherInteger [ "int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int, void(*)(void*))" ^ self ffiCall: #(int sqlite3_bind_text (sqlite3_stmt* aStatement, int aColumn, String aString, int anInteger, int anotherInteger)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiChanges: handle [ "int sqlite3_changes(sqlite3*)" ^ self ffiCall: #(int sqlite3_changes (sqlite3 *handle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiClearBindings: aStatement [ "int sqlite3_clear_bindings(sqlite3_stmt*)" ^ self ffiCall: #(int sqlite3_clear_bindings (sqlite3_stmt* aStatement)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiClose: handle [ "int sqlite3_close_v2(sqlite3*)" ^self ffiCall: #(int sqlite3_close_v2(sqlite3 *handle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiColumnBlob: aStatement atColumn: aColumn [ "const void *sqlite3_column_blob(sqlite3_stmt*, int)" ^ self ffiCall: #(const void *sqlite3_column_blob (sqlite3_stmt* aStatement, int aColumn)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiColumnBytes: aStatement atColumn: aColumn [ "int sqlite3_column_bytes(sqlite3_stmt*, int)" ^ self ffiCall: #(int sqlite3_column_bytes (sqlite3_stmt* aStatement, int aColumn)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiColumnCount: aStatement [ "int sqlite3_column_count(sqlite3_stmt *pStmt)" ^ self ffiCall: #(int sqlite3_column_count(sqlite3_stmt *aStatement)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiColumnDeclaredType: aStatement atColumn: aColumn [ "const char *sqlite3_column_decltype(sqlite3_stmt*, int)" @@ -229,21 +231,21 @@ SQLite3Library >> apiColumnDeclaredType: aStatement atColumn: aColumn [ ffiCall: #(String sqlite3_column_decltype #(sqlite3_stmt *aStatement, int aColumn)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiColumnDouble: aStatement atColumn: aColumn [ "double sqlite3_column_double(sqlite3_stmt*, int)" ^ self ffiCall: #(double sqlite3_column_double (sqlite3_stmt* aStatement, int aColumn)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiColumnInt: aStatement atColumn: aColumn [ "int sqlite3_column_int(sqlite3_stmt*, int)" ^ self ffiCall: #(sqlite3_int64 sqlite3_column_int64 (sqlite3_stmt* aStatement, int aColumn)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiColumnName: aStatement atColumn: aColumn [ "const char *sqlite3_column_name(sqlite3_stmt*, int)" @@ -251,14 +253,14 @@ SQLite3Library >> apiColumnName: aStatement atColumn: aColumn [ ffiCall: #(String sqlite3_column_name(sqlite3_stmt* aStatement, int aColumn)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiColumnText: aStatement atColumn: aColumn [ "const unsigned char *sqlite3_column_text(sqlite3_stmt*, int)" ^ self ffiCall: #(String sqlite3_column_text (sqlite3_stmt* aStatement, int aColumn)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiColumnType: aStatement atColumn: aColumn [ "int sqlite3_column_type(sqlite3_stmt*, int)" @@ -266,7 +268,7 @@ SQLite3Library >> apiColumnType: aStatement atColumn: aColumn [ ffiCall: #(int sqlite3_column_type(sqlite3_stmt* aStatement,int aColumn)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiConfigLoadExtension: dbHandle with: op with: onoff with: retpointer [ "This is a specific invocation of sqlite3_db_config(sqlite3*, int, ...)." @@ -279,63 +281,63 @@ This option is used to enable or disable the sqlite3_load_extension() interface " ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiDBHandle: statementHandle [ "sqlite3 *sqlite3_db_handle(sqlite3_stmt*);" ^self ffiCall: #(SQLite3DatabaseExternalObject *sqlite3_db_handle(SQLite3StatementExternalObject *statementHandle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiDataCount: handle [ "int sqlite3_data_count(sqlite3_stmt*)" ^ self ffiCall: #(int sqlite3_data_count (sqlite3_stmt *handle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiErrorMessage: handle [ "const char *sqlite3_errmsg(sqlite3*)" ^self ffiCall: #(String sqlite3_errmsg(sqlite3 *handle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiExec: dbHandle withSQLText: anSQLText with: callback with: callbackData with: errorMessageBuffer [ "int sqlite3_exec(sqlite3*, const char*, int (*callback), void*, char **)" ^self ffiCall: #(int sqlite3_exec (sqlite3 *dbHandle, String anSQLText, void *callback, void *callbackData, char **errorMessageBuffer)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiFinalize: handle [ "int sqlite3_finalize(sqlite3_stmt*)" ^self ffiCall: #(int sqlite3_finalize(sqlite3_stmt *handle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiGetAutocommit: handle [ "int sqlite3_get_autocommit(sqlite3*);" ^ self ffiCall: #(int sqlite3_get_autocommit (sqlite3 *handle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiLastInsertRowid: handle [ "sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*)" ^ self ffiCall: #(long sqlite3_last_insert_rowid(SQLite3DatabaseExternalObject *handle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiLibVersion [ "const char *sqlite3_libversion(void)" ^self ffiCall: #(String sqlite3_libversion(void)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiLoadExtension: dbHandle with: zFile with: zProc with: pzErrMsg [ "int sqlite3_load_extension(sqlite3*, const char*, const char*, char **)." @@ -343,14 +345,14 @@ SQLite3Library >> apiLoadExtension: dbHandle with: zFile with: zProc with: pzErr module: self library ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiOpen: filename via: handle [ "int sqlite3_open(const char*, sqlite3**)" ^self ffiCall: #(int sqlite3_open(String filename, sqlite3 **handle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiOpen: filename withFlags: flags vfs: vfs via: handle [ "int sqlite3_open_v2( const char *filename, /* Database filename (UTF-8) */ @@ -362,89 +364,89 @@ SQLite3Library >> apiOpen: filename withFlags: flags vfs: vfs via: handle [ ^self ffiCall: #(int sqlite3_open_v2(String filename, sqlite3 **handle, int flags, String vfs)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiPrepare: dbHandle withSQLText: anSQLText with: textSize with: sHandle with: tail [ "int sqlite3_prepare_v2(sqlite3*, const char*, int, sqlite3_stmt**, const char **)" ^ self ffiCall: #(int sqlite3_prepare_v2 (sqlite3* dbHandle, String anSQLText, int textSize, sqlite3_stmt** sHandle, const char** tail)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiReset: handle [ "int sqlite3_reset(sqlite3_stmt*)" ^ self ffiCall: #(int sqlite3_reset (sqlite3_stmt *handle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiSleep [ "int sqlite3_sleep(int)" ^ self ffiCall: #(int sqlite3_sleep(int)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiSql: handle [ "const char *sqlite3_sql(sqlite3_stmt*)" ^ self ffiCall: #(String sqlite3_sql (sqlite3_stmt* handle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiStatementReadOnly: handle [ "int sqlite3_stmt_readonly(sqlite3_stmt *pStmt)" ^ self ffiCall: #(int sqlite3_stmt_readonly (SQLite3StatementExternalObject * handle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiStep: handle [ "int sqlite3_step(sqlite3_stmt*)" ^ self ffiCall: #(int sqlite3_step (sqlite3_stmt* handle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiThreadsafe [ "int sqlite3_threadsafe(void)" ^self ffiCall: #(int sqlite3_threadsafe(void)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiTotalChanges: handle [ "int sqlite3_total_changes(sqlite3*)" ^ self ffiCall: #(int sqlite3_total_changes (sqlite3 *handle)) ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> apiTrace: handle with: callback with: appdata [ ^ self ffiCall: #(void* sqlite3_trace (sqlite3* handle, FFICallback callback, ExternalAddress appdata)) ] -{ #category : #operating } +{ #category : 'operating' } SQLite3Library >> backup: backupHandle step: nPages [ ^self apiBackupStep: nPages via: backupHandle ] -{ #category : #operating } +{ #category : 'operating' } SQLite3Library >> backupTo: dstConnection named: dstName from: srcConnection named: srcName [ ^self apiBackupTo: dstConnection named: dstName from: srcConnection named: srcName ] -{ #category : #operating } +{ #category : 'operating' } SQLite3Library >> bindParameterCount: aStatementHandle [ ^ self apiBindParameterCount: aStatementHandle ] -{ #category : #operating } +{ #category : 'operating' } SQLite3Library >> bindParameterIndex: aStatementHandle for: aName [ ^ self apiBindParameterIndex: aStatementHandle for: aName ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Library >> blobFrom: aStatement at: aColumn [ | address size array | @@ -454,7 +456,7 @@ SQLite3Library >> blobFrom: aStatement at: aColumn [ ^array ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Library >> booleanFrom: aStatement at: aColumn [ | declared selector value | @@ -484,46 +486,46 @@ SQLite3Library >> booleanFrom: aStatement at: aColumn [ ifFalse: [ SQLite3AbstractError signal: 'Column value cannot be read as a boolean.' ]]] ] -{ #category : #introspection } +{ #category : 'introspection' } SQLite3Library >> changes: aHandle [ ^ self apiChanges: aHandle ] -{ #category : #'private - utilities' } +{ #category : 'private - utilities' } SQLite3Library >> checkForOk: anInteger on: aHandle [ ^ self sqlite3ResultFor: anInteger ifNoneMatch: [ (SQLite3NativeError forNativeErrorCode: anInteger messageText: (self apiErrorMessage: aHandle)) signal ] ] -{ #category : #cleaning } +{ #category : 'cleaning' } SQLite3Library >> clearBindings: sHandle on: dbHandle [ ^ self checkForOk: (self apiClearBindings: sHandle) on: dbHandle ] -{ #category : #'connection handling' } +{ #category : 'connection handling' } SQLite3Library >> close: aHandle [ ^ self apiClose: aHandle ] -{ #category : #'connection handling' } +{ #category : 'connection handling' } SQLite3Library >> columnCount: aStatementHandle [ ^ self apiColumnCount: aStatementHandle ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Library >> dataValuesAvailable: aStatementHandle [ ^ self apiDataCount: aStatementHandle ] -{ #category : #'connection handling' } +{ #category : 'connection handling' } SQLite3Library >> dbHandle: statementHandle [ ^self apiDBHandle: statementHandle ] -{ #category : #configuring } +{ #category : 'configuring' } SQLite3Library >> disableLoadExtension: aHandle [ ^ self checkForOk: (self apiConfigLoadExtension: aHandle with: 1005 with: 0 with: ExternalAddress new) on: aHandle @@ -532,7 +534,7 @@ SQLite3Library >> disableLoadExtension: aHandle [ See comment in #apiConfigLoadExtension:with:with:with:." ] -{ #category : #configuring } +{ #category : 'configuring' } SQLite3Library >> enableLoadExtension: aHandle [ ^ self checkForOk: (self apiConfigLoadExtension: aHandle with: 1005 with: 1 with: ExternalAddress new) on: aHandle @@ -541,7 +543,7 @@ SQLite3Library >> enableLoadExtension: aHandle [ See comment in #apiConfigLoadExtension:with:with:with:." ] -{ #category : #operating } +{ #category : 'operating' } SQLite3Library >> execute: anSQLText on: aDBHandle [ | null | null := ExternalAddress new. @@ -553,7 +555,7 @@ SQLite3Library >> execute: anSQLText on: aDBHandle [ on: aDBHandle ] -{ #category : #operating } +{ #category : 'operating' } SQLite3Library >> finalize: aStatementHandle on: aDBHandle [ | result | result := self checkForOk: (self apiFinalize: aStatementHandle) on: aDBHandle. @@ -561,49 +563,49 @@ SQLite3Library >> finalize: aStatementHandle on: aDBHandle [ ^ result ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Library >> floatFrom: aStatement at: aColumn [ ^ self apiColumnDouble: aStatement atColumn: aColumn ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Library >> getAutoCommit: aHandle [ ^ (self apiGetAutocommit: aHandle) ~= 0 ] -{ #category : #operating } +{ #category : 'operating' } SQLite3Library >> integerFrom: aStatement at: aColumn [ ^ self apiColumnInt: aStatement atColumn: aColumn ] -{ #category : #testing } +{ #category : 'testing' } SQLite3Library >> isThreadsafe [ "http://sqlite.org/c3ref/threadsafe.html" ^ self apiThreadsafe ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Library >> lastInsertRowId: dbHandle [ ^ self apiLastInsertRowid: dbHandle ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Library >> library [ ^self libraryName ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Library >> libraryVersion [ "See http://sqlite.org/c3ref/libversion.html" ^self apiLibVersion ] -{ #category : #'private - api' } +{ #category : 'private - api' } SQLite3Library >> loadExtension: dbHandle with: aFilename [ ^ self checkForOk: (self apiLoadExtension: dbHandle @@ -613,7 +615,7 @@ SQLite3Library >> loadExtension: dbHandle with: aFilename [ on: dbHandle ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Library >> macLibraryName [ | pluginDir | pluginDir := FileSystem /'usr'/'lib'. @@ -624,34 +626,34 @@ SQLite3Library >> macLibraryName [ self error: 'Module not found.' ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Library >> nameFor: aStatement at: aColumn [ ^ self apiColumnName: aStatement atColumn: aColumn ] -{ #category : #'connection handling' } +{ #category : 'connection handling' } SQLite3Library >> open: aFilename via: aHandle [ ^ self checkForOk: (self apiOpen: aFilename via: aHandle) on: aHandle ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Library >> open: aFilename withFlags: flags vfs: vfs via: aHandle [ ^ self checkForOk: (self apiOpen: aFilename withFlags: flags vfs: vfs via: aHandle) on: aHandle ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Library >> open: aFilename withFlags: flags via: aHandle [ ^ self checkForOk: (self apiOpen: aFilename withFlags: flags vfs: nil via: aHandle) on: aHandle ] -{ #category : #'private - conversion' } +{ #category : 'private - conversion' } SQLite3Library >> pharoStringToUTF8: aPharoString [ "Converts from Pharo Multibyte Characters to SQLite3 UTF-8 storage format" ^ZnUTF8Encoder new encodeString: aPharoString ] -{ #category : #operating } +{ #category : 'operating' } SQLite3Library >> prepare: aStatementHandle on: aDBHandle with: anSQLText [ | utf8SQL | @@ -664,7 +666,7 @@ SQLite3Library >> prepare: aStatementHandle on: aDBHandle with: anSQLText [ on: aDBHandle ] -{ #category : #cleaning } +{ #category : 'cleaning' } SQLite3Library >> reset: aStatementHandle [ ^ aStatementHandle @@ -672,19 +674,19 @@ SQLite3Library >> reset: aStatementHandle [ ifNotNil: [ self apiReset: aStatementHandle ] ] -{ #category : #'private - utilities' } +{ #category : 'private - utilities' } SQLite3Library >> signal: exceptionClass with: value on: handle [ (exceptionClass new) resultCode: value; signal: (self apiErrorMessage: handle) ] -{ #category : #stepping } +{ #category : 'stepping' } SQLite3Library >> sqlText: aStatementHandle [ ^ self apiSql: aStatementHandle ] -{ #category : #'private - utilities' } +{ #category : 'private - utilities' } SQLite3Library >> sqlite3ResultFor: anInteger ifNoneMatch: aBlock [ ^[ @@ -692,19 +694,19 @@ SQLite3Library >> sqlite3ResultFor: anInteger ifNoneMatch: aBlock [ ] on: NotFound do: aBlock ] -{ #category : #stepping } +{ #category : 'stepping' } SQLite3Library >> statementReadOnly: handle [ "int sqlite3_stmt_readonly(sqlite3_stmt *pStmt)" ^ (self apiStatementReadOnly: handle) ~= 0 ] -{ #category : #stepping } +{ #category : 'stepping' } SQLite3Library >> step: aStatementHandle [ ^ self apiStep: aStatementHandle ] -{ #category : #testing } +{ #category : 'testing' } SQLite3Library >> threadsafe [ "This method is deprecated so consider to migrate." self deprecated: 'Please use #isThreadsafe instead' transformWith: '`@receiver threadsafe' @@ -713,17 +715,17 @@ SQLite3Library >> threadsafe [ ^ self isThreadsafe ] -{ #category : #introspection } +{ #category : 'introspection' } SQLite3Library >> totalChanges: aHandle [ ^ self apiTotalChanges: aHandle ] -{ #category : #tracing } +{ #category : 'tracing' } SQLite3Library >> trace: handle with: callback with: appdata [ ^ self apiTrace: handle with: callback with: appdata ] -{ #category : #'private - utilities' } +{ #category : 'private - utilities' } SQLite3Library >> typeFor: aStatement at: aColumn [ | selector declared | @@ -738,7 +740,7 @@ SQLite3Library >> typeFor: aStatement at: aColumn [ ^ selector ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Library >> unix32LibraryName [ (#('/usr/lib/i386-linux-gnu' '/usr/lib32' '/usr/lib'), ((OSEnvironment current at: 'LD_LIBRARY_PATH' ifAbsent: [ '' ]) substrings: ':')) @@ -751,7 +753,7 @@ SQLite3Library >> unix32LibraryName [ self error: 'Module not found.' ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Library >> unix64LibraryName [ (#('/usr/lib/x86_64-linux-gnu' '/lib/x86_64-linux-gnu' '/usr/lib64' '/usr/lib'), ((OSEnvironment current at: 'LD_LIBRARY_PATH' ifAbsent: [ '' ]) substrings: ':')) @@ -764,12 +766,12 @@ SQLite3Library >> unix64LibraryName [ self error: 'Module not found.' ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Library >> win32LibraryName [ ^ FFIWindowsLibraryFinder findLibrary: 'sqlite3.dll' ] -{ #category : #operating } +{ #category : 'operating' } SQLite3Library >> with: aStatement at: aColumn putBlob: aByteArray [ ^ self @@ -780,17 +782,17 @@ SQLite3Library >> with: aStatement at: aColumn putBlob: aByteArray [ with: 0 ] -{ #category : #operating } +{ #category : 'operating' } SQLite3Library >> with: aStatement at: aColumn putFloat: aFloat [ ^ self apiBindDouble: aStatement atColumn: aColumn with: aFloat ] -{ #category : #operating } +{ #category : 'operating' } SQLite3Library >> with: aStatement at: aColumn putInteger: anInteger [ ^ self apiBindInteger: aStatement atColumn: aColumn with: anInteger ] -{ #category : #operating } +{ #category : 'operating' } SQLite3Library >> with: aStatement at: aColumn putText: aString [ | bytes | @@ -805,7 +807,7 @@ SQLite3Library >> with: aStatement at: aColumn putText: aString [ with: 0 ] -{ #category : #operating } +{ #category : 'operating' } SQLite3Library >> with: aStatement putNullAt: aColumn [ ^ self apiBindNull: aStatement atColumn: aColumn ] diff --git a/src/SQLite3-Core/SQLite3Locked.class.st b/src/SQLite3-Core/SQLite3Locked.class.st index 0e6bc3b..d3a2e0f 100644 --- a/src/SQLite3-Core/SQLite3Locked.class.st +++ b/src/SQLite3-Core/SQLite3Locked.class.st @@ -6,12 +6,14 @@ For example, a DROP TABLE statement cannot be run while another thread is readin The SQLITE_LOCKED result code differs from SQLITE_BUSY in that SQLITE_LOCKED indicates a conflict on the same database connection (or on a connection with a shared cache) whereas SQLITE_BUSY indicates a conflict with a different database connection, probably in a different process. " Class { - #name : #SQLite3Locked, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3Locked', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Locked class >> nativeErrorCode [ ^ SQLITE_LOCKED diff --git a/src/SQLite3-Core/SQLite3LockedSharedCache.class.st b/src/SQLite3-Core/SQLite3LockedSharedCache.class.st index 787eb30..24971a3 100644 --- a/src/SQLite3-Core/SQLite3LockedSharedCache.class.st +++ b/src/SQLite3-Core/SQLite3LockedSharedCache.class.st @@ -4,12 +4,14 @@ The SQLITE_LOCKED_SHAREDCACHE error code is an extended error code for SQLITE_LO The SQLITE_LOCKED_SHARECACHE error code works very much like the SQLITE_BUSY error code except that SQLITE_LOCKED_SHARECACHE is for separate database connections that share a cache whereas SQLITE_BUSY is for the much more common case of separate database connections that do not share the same cache. Also, the sqlite3_busy_handler() and sqlite3_busy_timeout() interfaces do not help in resolving SQLITE_LOCKED_SHAREDCACHE conflicts. " Class { - #name : #SQLite3LockedSharedCache, - #superclass : #SQLite3Locked, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3LockedSharedCache', + #superclass : 'SQLite3Locked', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3LockedSharedCache class >> nativeErrorCode [ ^ SQLITE_LOCKED_SHAREDCACHE diff --git a/src/SQLite3-Core/SQLite3LogNotice.class.st b/src/SQLite3-Core/SQLite3LogNotice.class.st index 2b4bfff..483264b 100644 --- a/src/SQLite3-Core/SQLite3LogNotice.class.st +++ b/src/SQLite3-Core/SQLite3LogNotice.class.st @@ -2,12 +2,14 @@ The SQLITE_NOTICE result code is not returned by any C/C++ interface. However, SQLITE_NOTICE (or rather one of its extended error codes) is sometimes used as the first argument in an sqlite3_log() callback to indicate that an unusual operation is taking place. " Class { - #name : #SQLite3LogNotice, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3LogNotice', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3LogNotice class >> nativeErrorCode [ ^ SQLITE_NOTICE diff --git a/src/SQLite3-Core/SQLite3LogNoticeRecoverRollback.class.st b/src/SQLite3-Core/SQLite3LogNoticeRecoverRollback.class.st index 7a0016a..1241ccd 100644 --- a/src/SQLite3-Core/SQLite3LogNoticeRecoverRollback.class.st +++ b/src/SQLite3-Core/SQLite3LogNoticeRecoverRollback.class.st @@ -2,12 +2,14 @@ The SQLITE_NOTICE_RECOVER_ROLLBACK result code is passed to the callback of sqlite3_log() when a hot journal is rolled back. " Class { - #name : #SQLite3LogNoticeRecoverRollback, - #superclass : #SQLite3LogNotice, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3LogNoticeRecoverRollback', + #superclass : 'SQLite3LogNotice', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3LogNoticeRecoverRollback class >> nativeErrorCode [ ^ SQLITE_NOTICE_RECOVER_ROLLBACK diff --git a/src/SQLite3-Core/SQLite3LogNoticeRecoverWriteAheadLogging.class.st b/src/SQLite3-Core/SQLite3LogNoticeRecoverWriteAheadLogging.class.st index f8702a8..cad3349 100644 --- a/src/SQLite3-Core/SQLite3LogNoticeRecoverWriteAheadLogging.class.st +++ b/src/SQLite3-Core/SQLite3LogNoticeRecoverWriteAheadLogging.class.st @@ -2,12 +2,14 @@ The SQLITE_NOTICE_RECOVER_WAL result code is passed to the callback of sqlite3_log() when a WAL mode database file is recovered. " Class { - #name : #SQLite3LogNoticeRecoverWriteAheadLogging, - #superclass : #SQLite3LogNotice, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3LogNoticeRecoverWriteAheadLogging', + #superclass : 'SQLite3LogNotice', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3LogNoticeRecoverWriteAheadLogging class >> nativeErrorCode [ ^ SQLITE_NOTICE_RECOVER_WAL diff --git a/src/SQLite3-Core/SQLite3LogWarning.class.st b/src/SQLite3-Core/SQLite3LogWarning.class.st index 3cd7e47..498e54e 100644 --- a/src/SQLite3-Core/SQLite3LogWarning.class.st +++ b/src/SQLite3-Core/SQLite3LogWarning.class.st @@ -2,12 +2,14 @@ The SQLITE_WARNING result code is not returned by any C/C++ interface. However, SQLITE_WARNING (or rather one of its extended error codes) is sometimes used as the first argument in an sqlite3_log() callback to indicate that an unusual and possibly ill-advised operation is taking place. " Class { - #name : #SQLite3LogWarning, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3LogWarning', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3LogWarning class >> nativeErrorCode [ ^ SQLITE_WARNING diff --git a/src/SQLite3-Core/SQLite3LogWarningAutoIndex.class.st b/src/SQLite3-Core/SQLite3LogWarningAutoIndex.class.st index d279801..893027c 100644 --- a/src/SQLite3-Core/SQLite3LogWarningAutoIndex.class.st +++ b/src/SQLite3-Core/SQLite3LogWarningAutoIndex.class.st @@ -2,12 +2,14 @@ The SQLITE_WARNING_AUTOINDEX result code is passed to the callback of sqlite3_log() whenever automatic indexing is used. This can serve as a warning to application designers that the database might benefit from additional indexes. " Class { - #name : #SQLite3LogWarningAutoIndex, - #superclass : #SQLite3LogWarning, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3LogWarningAutoIndex', + #superclass : 'SQLite3LogWarning', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3LogWarningAutoIndex class >> nativeErrorCode [ ^ SQLITE_WARNING_AUTOINDEX diff --git a/src/SQLite3-Core/SQLite3Mismatch.class.st b/src/SQLite3-Core/SQLite3Mismatch.class.st index c9ae362..3b5096d 100644 --- a/src/SQLite3-Core/SQLite3Mismatch.class.st +++ b/src/SQLite3-Core/SQLite3Mismatch.class.st @@ -6,12 +6,14 @@ SQLite is normally very forgiving about mismatches between the type of a value a The rowid of a table must be an integer. Attempt to set the rowid to anything other than an integer (or a NULL which will be automatically converted into the next available integer rowid) results in an SQLITE_MISMATCH error. " Class { - #name : #SQLite3Mismatch, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3Mismatch', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Mismatch class >> nativeErrorCode [ ^ SQLITE_MISMATCH diff --git a/src/SQLite3-Core/SQLite3Misuse.class.st b/src/SQLite3-Core/SQLite3Misuse.class.st index ead5001..0256c4a 100644 --- a/src/SQLite3-Core/SQLite3Misuse.class.st +++ b/src/SQLite3-Core/SQLite3Misuse.class.st @@ -6,12 +6,14 @@ SQLite tries to detect misuse and report the misuse using this result code. Howe If SQLite ever returns SQLITE_MISUSE from any interface, that means that the application is incorrectly coded and needs to be fixed. Do not ship an application that sometimes returns SQLITE_MISUSE from a standard SQLite interface because that application contains potentially serious bugs. " Class { - #name : #SQLite3Misuse, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3Misuse', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Misuse class >> nativeErrorCode [ ^ SQLITE_MISUSE diff --git a/src/SQLite3-Core/SQLite3NativeError.class.st b/src/SQLite3-Core/SQLite3NativeError.class.st index 4f9bdd2..96c78e7 100644 --- a/src/SQLite3-Core/SQLite3NativeError.class.st +++ b/src/SQLite3-Core/SQLite3NativeError.class.st @@ -6,21 +6,23 @@ Typically one uses this class to create and access instances of subclasses: (SQLite3NativeError forNativeErrorCode: SQLITE_INTERRUPT messageText: 'Interrupted') signal " Class { - #name : #SQLite3NativeError, - #superclass : #SQLite3AbstractError, + #name : 'SQLite3NativeError', + #superclass : 'SQLite3AbstractError', #pools : [ 'SQLite3Constants' ], - #category : #'SQLite3-Core-Errors' + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #examples } +{ #category : 'examples' } SQLite3NativeError class >> example [ (SQLite3NativeError forNativeErrorCode: SQLITE_INTERRUPT messageText: 'Interrupted') signal ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3NativeError class >> forNativeErrorCode: anInteger messageText: aString [ ^(self subclassForNativeErrorCode: anInteger) new @@ -28,20 +30,20 @@ SQLite3NativeError class >> forNativeErrorCode: anInteger messageText: aString [ yourself ] -{ #category : #testing } +{ #category : 'testing' } SQLite3NativeError class >> isAbstract [ ^self name = #SQLite3NativeError ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3NativeError class >> nativeErrorCode [ "Returns the native error code as defined by SQLite C library." ^ self subclassResponsibility ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3NativeError class >> subclassForNativeErrorCode: anInteger [ ^ self subclasses detect: [ :subclass | subclass nativeErrorCode = anInteger ] diff --git a/src/SQLite3-Core/SQLite3NoLargeFileSupport.class.st b/src/SQLite3-Core/SQLite3NoLargeFileSupport.class.st index 5e5ffe7..915fd5b 100644 --- a/src/SQLite3-Core/SQLite3NoLargeFileSupport.class.st +++ b/src/SQLite3-Core/SQLite3NoLargeFileSupport.class.st @@ -2,12 +2,14 @@ The SQLITE_NOLFS error can be returned on systems that do not support large files when the database grows to be larger than what the filesystem can handle. ""NOLFS"" stands for ""NO Large File Support"". " Class { - #name : #SQLite3NoLargeFileSupport, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3NoLargeFileSupport', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3NoLargeFileSupport class >> nativeErrorCode [ ^ SQLITE_NOLFS diff --git a/src/SQLite3-Core/SQLite3NoMemory.class.st b/src/SQLite3-Core/SQLite3NoMemory.class.st index f87bbcf..4c920cd 100644 --- a/src/SQLite3-Core/SQLite3NoMemory.class.st +++ b/src/SQLite3-Core/SQLite3NoMemory.class.st @@ -2,12 +2,14 @@ The SQLITE_NOMEM result code indicates that SQLite was unable to allocate all the memory it needed to complete the operation. In other words, an internal call to sqlite3_malloc() or sqlite3_realloc() has failed in a case where the memory being allocated was required in order to continue the operation. " Class { - #name : #SQLite3NoMemory, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3NoMemory', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3NoMemory class >> nativeErrorCode [ ^SQLITE_NOMEM diff --git a/src/SQLite3-Core/SQLite3NotADatabase.class.st b/src/SQLite3-Core/SQLite3NotADatabase.class.st index 1f05b92..61a3cfb 100644 --- a/src/SQLite3-Core/SQLite3NotADatabase.class.st +++ b/src/SQLite3-Core/SQLite3NotADatabase.class.st @@ -2,12 +2,14 @@ When attempting to open a file, the SQLITE_NOTADB error indicates that the file being opened does not appear to be an SQLite database file. " Class { - #name : #SQLite3NotADatabase, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3NotADatabase', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3NotADatabase class >> nativeErrorCode [ ^ SQLITE_NOTADB diff --git a/src/SQLite3-Core/SQLite3NotFound.class.st b/src/SQLite3-Core/SQLite3NotFound.class.st index d61503e..f0ee478 100644 --- a/src/SQLite3-Core/SQLite3NotFound.class.st +++ b/src/SQLite3-Core/SQLite3NotFound.class.st @@ -4,12 +4,14 @@ The SQLITE_NOTFOUND result code is used in two contexts. SQLITE_NOTFOUND can be The SQLITE_NOTFOUND result code is also used internally by the SQLite implementation, but those internal uses are not exposed to the application. " Class { - #name : #SQLite3NotFound, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3NotFound', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3NotFound class >> nativeErrorCode [ ^ SQLITE_NOTFOUND diff --git a/src/SQLite3-Core/SQLite3NotOpen.class.st b/src/SQLite3-Core/SQLite3NotOpen.class.st index af72824..dd321ed 100644 --- a/src/SQLite3-Core/SQLite3NotOpen.class.st +++ b/src/SQLite3-Core/SQLite3NotOpen.class.st @@ -3,7 +3,9 @@ I am signalled when operations are invoked on a database that is not open. " Class { - #name : #SQLite3NotOpen, - #superclass : #SQLite3AbstractError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3NotOpen', + #superclass : 'SQLite3AbstractError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } diff --git a/src/SQLite3-Core/SQLite3OKResult.class.st b/src/SQLite3-Core/SQLite3OKResult.class.st index c6e2fa0..c3cb1d1 100644 --- a/src/SQLite3-Core/SQLite3OKResult.class.st +++ b/src/SQLite3-Core/SQLite3OKResult.class.st @@ -2,12 +2,14 @@ The SQLITE_OK result code means that the operation was successful and that there were no errors. Most other result codes indicate an error. " Class { - #name : #SQLite3OKResult, - #superclass : #SQLite3Result, - #category : #'SQLite3-Core-Results' + #name : 'SQLite3OKResult', + #superclass : 'SQLite3Result', + #category : 'SQLite3-Core-Results', + #package : 'SQLite3-Core', + #tag : 'Results' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3OKResult class >> nativeResultCode [ ^ SQLITE_OK diff --git a/src/SQLite3-Core/SQLite3OutOfRange.class.st b/src/SQLite3-Core/SQLite3OutOfRange.class.st index 925cc3a..6bb0f06 100644 --- a/src/SQLite3-Core/SQLite3OutOfRange.class.st +++ b/src/SQLite3-Core/SQLite3OutOfRange.class.st @@ -2,12 +2,14 @@ The SQLITE_RANGE error indices that the parameter number argument to one of the sqlite3_bind routines or the column number in one of the sqlite3_column routines is out of range. " Class { - #name : #SQLite3OutOfRange, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3OutOfRange', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3OutOfRange class >> nativeErrorCode [ ^ SQLITE_RANGE diff --git a/src/SQLite3-Core/SQLite3Permission.class.st b/src/SQLite3-Core/SQLite3Permission.class.st index cfcc70c..68f030e 100644 --- a/src/SQLite3-Core/SQLite3Permission.class.st +++ b/src/SQLite3-Core/SQLite3Permission.class.st @@ -2,12 +2,14 @@ The SQLITE_PERM result code indicates that the requested access mode for a newly created database could not be provided. " Class { - #name : #SQLite3Permission, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3Permission', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Permission class >> nativeErrorCode [ ^ SQLITE_PERM diff --git a/src/SQLite3-Core/SQLite3PreparedStatement.class.st b/src/SQLite3-Core/SQLite3PreparedStatement.class.st index e1eff3b..3726e8b 100644 --- a/src/SQLite3-Core/SQLite3PreparedStatement.class.st +++ b/src/SQLite3-Core/SQLite3PreparedStatement.class.st @@ -2,8 +2,8 @@ I represent an SQLite prepared statement. " Class { - #name : #SQLite3PreparedStatement, - #superclass : #Object, + #name : 'SQLite3PreparedStatement', + #superclass : 'Object', #instVars : [ 'connection', 'handle', @@ -14,10 +14,12 @@ Class { #pools : [ 'SQLite3Constants' ], - #category : #'SQLite3-Core-Database' + #category : 'SQLite3-Core-Database', + #package : 'SQLite3-Core', + #tag : 'Database' } -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> at: aColumn putBoolean: aBoolean [ ^ self library @@ -28,7 +30,7 @@ SQLite3PreparedStatement >> at: aColumn putBoolean: aBoolean [ "See http://www.sqlite.org/datatype3.html." ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> at: aColumn putByteArray: anObject [ | byteArray | @@ -36,7 +38,7 @@ SQLite3PreparedStatement >> at: aColumn putByteArray: anObject [ ^ self library with: handle at: aColumn putBlob: byteArray ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> at: aColumn putDate: aDate [ | string | @@ -47,7 +49,7 @@ SQLite3PreparedStatement >> at: aColumn putDate: aDate [ ^ self library with: handle at: aColumn putText: string ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> at: aColumn putDateTime: aDateTime [ | string | @@ -58,7 +60,7 @@ SQLite3PreparedStatement >> at: aColumn putDateTime: aDateTime [ ^ self library with: handle at: aColumn putText: string ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> at: aColumn putFloat: aFloat [ | f | @@ -68,20 +70,20 @@ SQLite3PreparedStatement >> at: aColumn putFloat: aFloat [ ^ self library with: handle at: aColumn putFloat: f ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> at: aColumn putInteger: anInteger [ ^ self library with: handle at: aColumn putInteger: anInteger ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> at: aColumn putNil: anObject [ "Goofy interface note - anObject is ignored here." "When used by SQLite3Connection, anObject will always be nil." ^ self library with: handle putNullAt: aColumn ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> at: aColumn putObject: anObject [ | blob | @@ -92,7 +94,7 @@ SQLite3PreparedStatement >> at: aColumn putObject: anObject [ putBlob: blob ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> at: aColumn putString: aString [ | s | @@ -101,7 +103,7 @@ SQLite3PreparedStatement >> at: aColumn putString: aString [ ^ self library with: handle at: aColumn putText: s ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> at: aColumn putTime: aTime [ | string | @@ -112,7 +114,7 @@ SQLite3PreparedStatement >> at: aColumn putTime: aTime [ ^ self library with: handle at: aColumn putText: string ] -{ #category : #public } +{ #category : 'public' } SQLite3PreparedStatement >> basicExecute: aBlock [ | ret | @@ -125,17 +127,17 @@ SQLite3PreparedStatement >> basicExecute: aBlock [ ret := self step ]] ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> bindParameterCount [ ^ self library bindParameterCount: handle ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> bindParameterIndex: aName [ ^ self library bindParameterIndex: handle for: aName ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> bindParameters: parameters [ "A 'variable' or 'parameter' token specifies a placeholder in the expression for a value that is filled in at runtime using the sqlite3_bind() family of C/C++ interfaces. Parameters can take several forms: @@ -165,27 +167,27 @@ Parameters that are not assigned values using sqlite3_bind() are treated as NULL self perform: (self dataTypeForObject: v) with: idx with: v ] ] ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> bindingAt: anObject ifAbsentPut: aBlock [ ^bindings at: anObject ifAbsentPut: aBlock ] -{ #category : #fetching } +{ #category : 'fetching' } SQLite3PreparedStatement >> booleanAt: aColumn [ ^self library booleanFrom: handle at: aColumn ] -{ #category : #fetching } +{ #category : 'fetching' } SQLite3PreparedStatement >> byteArrayAt: aColumn [ ^ self library blobFrom: handle at: aColumn ] -{ #category : #'public - accessing' } +{ #category : 'public - accessing' } SQLite3PreparedStatement >> changes [ ^changes ifNil: [ changes := 0 ] ] -{ #category : #private } +{ #category : 'private' } SQLite3PreparedStatement >> checkOk: aValue [ "These are normal conditions." @@ -201,7 +203,7 @@ SQLite3PreparedStatement >> checkOk: aValue [ connection signal: SQLite3AbstractError with: aValue ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> clearBindings [ | cleared | @@ -210,12 +212,12 @@ SQLite3PreparedStatement >> clearBindings [ ^cleared ] -{ #category : #public } +{ #category : 'public' } SQLite3PreparedStatement >> columnCount [ ^self library columnCount: handle ] -{ #category : #'public - accessing' } +{ #category : 'public - accessing' } SQLite3PreparedStatement >> columnNames [ ^ columnNames ifNil: [ @@ -223,12 +225,12 @@ SQLite3PreparedStatement >> columnNames [ columnNames ] ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3PreparedStatement >> connection: anObject [ connection := anObject ] -{ #category : #bindings } +{ #category : 'bindings' } SQLite3PreparedStatement >> dataTypeForObject: anObject [ anObject ifNil: [ ^ #at:putNil: ]. @@ -260,29 +262,29 @@ SQLite3PreparedStatement >> dataTypeForObject: anObject [ ^ #at:putObject: ] -{ #category : #'public - accessing' } +{ #category : 'public - accessing' } SQLite3PreparedStatement >> dataValuesAvailable [ ^ self library dataValuesAvailable: handle ] -{ #category : #fetching } +{ #category : 'fetching' } SQLite3PreparedStatement >> dateAt: aColumn [ ^ Date fromString: ( self stringAt: aColumn ) ] -{ #category : #fetching } +{ #category : 'fetching' } SQLite3PreparedStatement >> dateTimeAt: aColumn [ ^ DateAndTime fromString: ( self stringAt: aColumn ) ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3PreparedStatement >> dbHandle [ ^(self library dbHandle: handle) ] -{ #category : #operating } +{ #category : 'operating' } SQLite3PreparedStatement >> execute: parameters [ | result | @@ -294,7 +296,7 @@ SQLite3PreparedStatement >> execute: parameters [ ^ SQLite3Cursor on: self ] -{ #category : #initialization } +{ #category : 'initialization' } SQLite3PreparedStatement >> finalize [ "Finalize the statement as required by the SQLite3 API. As per the API, the user is expected to finalize a statement after use. @@ -309,18 +311,18 @@ SQLite3PreparedStatement >> finalize [ ^ 0 ] -{ #category : #fetching } +{ #category : 'fetching' } SQLite3PreparedStatement >> floatAt: aColumn [ ^self library floatFrom: handle at: aColumn ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3PreparedStatement >> handle [ ^ handle ] -{ #category : #initialization } +{ #category : 'initialization' } SQLite3PreparedStatement >> initialize [ super initialize. @@ -329,62 +331,62 @@ SQLite3PreparedStatement >> initialize [ handle autoRelease ] -{ #category : #fetching } +{ #category : 'fetching' } SQLite3PreparedStatement >> integerAt: aColumn [ ^self library integerFrom: handle at: aColumn ] -{ #category : #'private - testing' } +{ #category : 'private - testing' } SQLite3PreparedStatement >> isFloatLike: anObject [ ^ (anObject isKindOf: Float) or: [ anObject isKindOf: Fraction ] ] -{ #category : #'public - accessing' } +{ #category : 'public - accessing' } SQLite3PreparedStatement >> isReadOnly [ ^self library statementReadOnly: handle ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3PreparedStatement >> library [ ^SQLite3Library current ] -{ #category : #fetching } +{ #category : 'fetching' } SQLite3PreparedStatement >> nameOfColumn: aColumn [ ^ self library nameFor: handle at: aColumn ] -{ #category : #fetching } +{ #category : 'fetching' } SQLite3PreparedStatement >> nilAt: aColumn [ ^ nil ] -{ #category : #fetching } +{ #category : 'fetching' } SQLite3PreparedStatement >> objectAt: aColumn [ ^ FLMaterializer materializeFromByteArray: (self library blobFrom: handle at: aColumn) ] -{ #category : #public } +{ #category : 'public' } SQLite3PreparedStatement >> prepare: anSQLText [ self library prepare: handle on: connection handle with: anSQLText ] -{ #category : #public } +{ #category : 'public' } SQLite3PreparedStatement >> reset [ ^connection reset: self ] -{ #category : #operating } +{ #category : 'operating' } SQLite3PreparedStatement >> sqlText [ ^ self library sqlText: handle ] -{ #category : #public } +{ #category : 'public' } SQLite3PreparedStatement >> step [ ^ self stepOk: (self library step: handle) ] -{ #category : #private } +{ #category : 'private' } SQLite3PreparedStatement >> stepOk: aValue [ "These are normal conditions." @@ -404,7 +406,7 @@ SQLite3PreparedStatement >> stepOk: aValue [ connection signal: SQLite3AbstractError with: aValue ] -{ #category : #fetching } +{ #category : 'fetching' } SQLite3PreparedStatement >> stringAt: aColumn [ "Answer the string from the specified column" @@ -413,24 +415,24 @@ SQLite3PreparedStatement >> stringAt: aColumn [ ^ self library stringFrom: handle at: aColumn ] -{ #category : #fetching } +{ #category : 'fetching' } SQLite3PreparedStatement >> timeAt: aColumn [ ^ Time fromString: ( self stringAt: aColumn ) ] -{ #category : #fetching } +{ #category : 'fetching' } SQLite3PreparedStatement >> timestampAt: aColumn [ ^ DateAndTime fromString: ( self stringAt: aColumn ) ] -{ #category : #fetching } +{ #category : 'fetching' } SQLite3PreparedStatement >> typeOfColumn: aColumn [ ^ self library typeFor: handle at: aColumn ] -{ #category : #fetching } +{ #category : 'fetching' } SQLite3PreparedStatement >> valueOfColumn: aColumn [ ^ self perform: (self typeOfColumn: aColumn) with: aColumn ] diff --git a/src/SQLite3-Core/SQLite3Protocol.class.st b/src/SQLite3-Core/SQLite3Protocol.class.st index 4a6669b..8a97dc4 100644 --- a/src/SQLite3-Core/SQLite3Protocol.class.st +++ b/src/SQLite3-Core/SQLite3Protocol.class.st @@ -2,12 +2,14 @@ The SQLITE_PROTOCOL result code indicates a problem with the file locking protocol used by SQLite. The SQLITE_PROTOCOL error is currently only returned when using WAL mode and attempting to start a new transaction. There is a race condition that can occur when two separate database connections both try to start a transaction at the same time in WAL mode. The loser of the race backs off and tries again, after a brief delay. If the same connection loses the locking race dozens of times over a span of multiple seconds, it will eventually give up and return SQLITE_PROTOCOL. The SQLITE_PROTOCOL error should appear in practice very, very rarely, and only when there are many separate processes all competing intensely to write to the same database. " Class { - #name : #SQLite3Protocol, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3Protocol', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Protocol class >> nativeErrorCode [ ^ SQLITE_PROTOCOL diff --git a/src/SQLite3-Core/SQLite3ReadOnly.class.st b/src/SQLite3-Core/SQLite3ReadOnly.class.st index 4e84da0..85ded25 100644 --- a/src/SQLite3-Core/SQLite3ReadOnly.class.st +++ b/src/SQLite3-Core/SQLite3ReadOnly.class.st @@ -2,12 +2,14 @@ The SQLITE_READONLY result code is returned when an attempt is made to alter some data for which the current database connection does not have write permission. " Class { - #name : #SQLite3ReadOnly, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3ReadOnly', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ReadOnly class >> nativeErrorCode [ ^ SQLITE_READONLY diff --git a/src/SQLite3-Core/SQLite3ReadOnlyCantLock.class.st b/src/SQLite3-Core/SQLite3ReadOnlyCantLock.class.st index 17b67a9..034d748 100644 --- a/src/SQLite3-Core/SQLite3ReadOnlyCantLock.class.st +++ b/src/SQLite3-Core/SQLite3ReadOnlyCantLock.class.st @@ -2,12 +2,14 @@ The SQLITE_READONLY_CANTLOCK error code is an extended error code for SQLITE_READONLY. The SQLITE_READONLY_CANTLOCK error code indicates that SQLite is unable to obtain a read lock on a WAL mode database because the shared-memory file associated with that database is read-only. " Class { - #name : #SQLite3ReadOnlyCantLock, - #superclass : #SQLite3ReadOnly, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3ReadOnlyCantLock', + #superclass : 'SQLite3ReadOnly', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ReadOnlyCantLock class >> nativeErrorCode [ ^ SQLITE_READONLY_CANTLOCK diff --git a/src/SQLite3-Core/SQLite3ReadOnlyDBMoved.class.st b/src/SQLite3-Core/SQLite3ReadOnlyDBMoved.class.st index 50cbbe4..998a9f4 100644 --- a/src/SQLite3-Core/SQLite3ReadOnlyDBMoved.class.st +++ b/src/SQLite3-Core/SQLite3ReadOnlyDBMoved.class.st @@ -2,12 +2,14 @@ The SQLITE_READONLY_DBMOVED error code is an extended error code for SQLITE_READONLY. The SQLITE_READONLY_DBMOVED error code indicates that a database cannot be modified because the database file has been moved since it was opened, and so any attempt to modify the database might result in database corruption if the processes crashes because the rollback journal would not be correctly named. " Class { - #name : #SQLite3ReadOnlyDBMoved, - #superclass : #SQLite3ReadOnly, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3ReadOnlyDBMoved', + #superclass : 'SQLite3ReadOnly', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ReadOnlyDBMoved class >> nativeErrorCode [ ^ SQLITE_READONLY_DBMOVED diff --git a/src/SQLite3-Core/SQLite3ReadOnlyRecovery.class.st b/src/SQLite3-Core/SQLite3ReadOnlyRecovery.class.st index db8108e..f9c6144 100644 --- a/src/SQLite3-Core/SQLite3ReadOnlyRecovery.class.st +++ b/src/SQLite3-Core/SQLite3ReadOnlyRecovery.class.st @@ -2,12 +2,14 @@ The SQLITE_READONLY_RECOVERY error code is an extended error code for SQLITE_READONLY. The SQLITE_READONLY_RECOVERY error code indicates that a WAL mode database cannot be opened because the database file needs to be recovered and recovery requires write access but only read access is available. " Class { - #name : #SQLite3ReadOnlyRecovery, - #superclass : #SQLite3ReadOnly, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3ReadOnlyRecovery', + #superclass : 'SQLite3ReadOnly', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ReadOnlyRecovery class >> nativeErrorCode [ ^ SQLITE_READONLY_RECOVERY diff --git a/src/SQLite3-Core/SQLite3ReadOnlyRollback.class.st b/src/SQLite3-Core/SQLite3ReadOnlyRollback.class.st index 5040104..a22d7cf 100644 --- a/src/SQLite3-Core/SQLite3ReadOnlyRollback.class.st +++ b/src/SQLite3-Core/SQLite3ReadOnlyRollback.class.st @@ -2,12 +2,14 @@ The SQLITE_READONLY_ROLLBACK error code is an extended error code for SQLITE_READONLY. The SQLITE_READONLY_ROLLBACK error code indicates that a database cannot be opened because it has a hot journal that needs to be rolled back but cannot because the database is readonly. " Class { - #name : #SQLite3ReadOnlyRollback, - #superclass : #SQLite3ReadOnly, - #category : #'SQLite3-Core-Errors-Extended' + #name : 'SQLite3ReadOnlyRollback', + #superclass : 'SQLite3ReadOnly', + #category : 'SQLite3-Core-Errors-Extended', + #package : 'SQLite3-Core', + #tag : 'Errors-Extended' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3ReadOnlyRollback class >> nativeErrorCode [ ^ SQLITE_READONLY_ROLLBACK diff --git a/src/SQLite3-Core/SQLite3Result.class.st b/src/SQLite3-Core/SQLite3Result.class.st index 9578a07..f85bf0e 100644 --- a/src/SQLite3-Core/SQLite3Result.class.st +++ b/src/SQLite3-Core/SQLite3Result.class.st @@ -6,32 +6,34 @@ Subclasses should not be instantiated directly. Instead use #forNativeResultCode SQLite3Result forNativeResultCode: SQLITE_OK " Class { - #name : #SQLite3Result, - #superclass : #Object, + #name : 'SQLite3Result', + #superclass : 'Object', #pools : [ 'SQLite3Constants' ], - #category : #'SQLite3-Core-Results' + #category : 'SQLite3-Core-Results', + #package : 'SQLite3-Core', + #tag : 'Results' } -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Result class >> forNativeResultCode: anInteger [ ^ (self subclassForNativeResultCode: anInteger) new ] -{ #category : #testing } +{ #category : 'testing' } SQLite3Result class >> isAbstract [ ^self name = #SQLite3Result ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Result class >> nativeResultCode [ ^ self subclassResponsibility ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Result class >> subclassForNativeResultCode: anInteger [ ^ self subclasses detect: [ :subclass | subclass nativeResultCode = anInteger ] diff --git a/src/SQLite3-Core/SQLite3Row.class.st b/src/SQLite3-Core/SQLite3Row.class.st index bfc682b..7e19bb6 100644 --- a/src/SQLite3-Core/SQLite3Row.class.st +++ b/src/SQLite3-Core/SQLite3Row.class.st @@ -3,16 +3,18 @@ I represent a row of results returned by the database. " Class { - #name : #SQLite3Row, - #superclass : #Object, + #name : 'SQLite3Row', + #superclass : 'Object', #instVars : [ 'values', 'columnNames' ], - #category : #'SQLite3-Core-Base' + #category : 'SQLite3-Core-Base', + #package : 'SQLite3-Core', + #tag : 'Base' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SQLite3Row class >> new: anInteger [ ^(self new) columnNames:(Array new:anInteger); @@ -20,17 +22,17 @@ SQLite3Row class >> new: anInteger [ yourself ] -{ #category : #converting } +{ #category : 'converting' } SQLite3Row >> asArray [ ^ self values asArray ] -{ #category : #converting } +{ #category : 'converting' } SQLite3Row >> asCombinedDictionary [ ^self asDictionary addAll: ((self values collectWithIndex:[:v :i | i -> v]) asDictionary); yourself ] -{ #category : #converting } +{ #category : 'converting' } SQLite3Row >> asDictionary [ "Borrowed from the future - Pharo 8" | dict | @@ -39,36 +41,36 @@ SQLite3Row >> asDictionary [ ^ dict ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> at: aKey [ ^ self at: aKey ifAbsent: [ ] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> at: aKey ifAbsent: aBlock [ ^ aKey isInteger ifTrue: [ self values at: aKey ifAbsent: aBlock ] ifFalse: [ self values at:(self columnNames indexOf: aKey) ifAbsent: aBlock ] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> at: aKey put: anObject [ ^ aKey isInteger ifTrue: [self atIndex: aKey put: anObject] ifFalse: [ self atName: aKey put: anObject ] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> atIndex: anIndex [ ^ values at: anIndex ifAbsent: [ ] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> atIndex: anIndex put: anObject [ ^ self values at: anIndex put: anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> atName: aKey [ | idx | idx := self columnNames indexOf: aKey. @@ -78,7 +80,7 @@ SQLite3Row >> atName: aKey [ ifFalse: [ values at: idx ] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> atName: aKey put: anObject [ | idx | ^ (idx := self columnNames indexOf: aKey) isZero @@ -88,29 +90,29 @@ SQLite3Row >> atName: aKey put: anObject [ ifFalse: [ values at: idx put: anObject ] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> columnNames [ ^ columnNames ifNil: [ #() ] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> columnNames: anArray [ columnNames := anArray. values := Array new: anArray size ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> data [ "compatibility" ^self asCombinedDictionary ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> dataCount [ ^ self columnNames size ] -{ #category : #'reflective operations' } +{ #category : 'reflective operations' } SQLite3Row >> doesNotUnderstand: aMessage [ ^ self at: aMessage selector asString @@ -120,27 +122,27 @@ SQLite3Row >> doesNotUnderstand: aMessage [ ifAbsent: [ super doesNotUnderstand: aMessage ]] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> first [ ^ self values ifEmpty: [] ifNotEmpty: [:v | v first ] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> last [ ^ self values ifEmpty: [ nil ] ifNotEmpty: [:v | v last ] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> size [ ^ self columnNames size ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> values [ ^values ifNil: [ #() ] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Row >> values: anArray [ values := anArray ] diff --git a/src/SQLite3-Core/SQLite3RowResult.class.st b/src/SQLite3-Core/SQLite3RowResult.class.st index 21d5c5f..74aff1f 100644 --- a/src/SQLite3-Core/SQLite3RowResult.class.st +++ b/src/SQLite3-Core/SQLite3RowResult.class.st @@ -2,12 +2,14 @@ The SQLITE_ROW result code returned by sqlite3_step() indicates that another row of output is available. " Class { - #name : #SQLite3RowResult, - #superclass : #SQLite3Result, - #category : #'SQLite3-Core-Results' + #name : 'SQLite3RowResult', + #superclass : 'SQLite3Result', + #category : 'SQLite3-Core-Results', + #package : 'SQLite3-Core', + #tag : 'Results' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3RowResult class >> nativeResultCode [ ^ SQLITE_ROW diff --git a/src/SQLite3-Core/SQLite3SchemaChanged.class.st b/src/SQLite3-Core/SQLite3SchemaChanged.class.st index 33efc50..f6104b6 100644 --- a/src/SQLite3-Core/SQLite3SchemaChanged.class.st +++ b/src/SQLite3-Core/SQLite3SchemaChanged.class.st @@ -4,12 +4,14 @@ The SQLITE_SCHEMA result code indicates that the database schema has changed. Th If a prepared statement is generated from sqlite3_prepare_v2() then the statement is automatically re-prepared if the schema changes, up to SQLITE_MAX_SCHEMA_RETRY times (default: 50). The sqlite3_step() interface will only return SQLITE_SCHEMA back to the application if the failure persists after these many retries. " Class { - #name : #SQLite3SchemaChanged, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3SchemaChanged', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3SchemaChanged class >> nativeErrorCode [ ^ SQLITE_SCHEMA diff --git a/src/SQLite3-Core/SQLite3StatementExternalObject.class.st b/src/SQLite3-Core/SQLite3StatementExternalObject.class.st index 60307cc..219090c 100644 --- a/src/SQLite3-Core/SQLite3StatementExternalObject.class.st +++ b/src/SQLite3-Core/SQLite3StatementExternalObject.class.st @@ -3,26 +3,28 @@ I represent the SQLite API 'sqlite3_stmt' C-level type. " Class { - #name : #SQLite3StatementExternalObject, - #superclass : #FFIOpaqueObject, - #category : #'SQLite3-Core-UFFI-Support' + #name : 'SQLite3StatementExternalObject', + #superclass : 'FFIOpaqueObject', + #category : 'SQLite3-Core-UFFI-Support', + #package : 'SQLite3-Core', + #tag : 'UFFI-Support' } -{ #category : #'instance finalization' } +{ #category : 'instance finalization' } SQLite3StatementExternalObject class >> doFinalizeResourceData: aHandle [ SQLite3Library current ffiCall: #( int sqlite3_finalize #( void * aHandle ) ) ] -{ #category : #finalization } +{ #category : 'finalization' } SQLite3StatementExternalObject class >> finalizeResourceData: aHandle [ self doFinalizeResourceData: aHandle. aHandle beNull ] -{ #category : #initialization } +{ #category : 'initialization' } SQLite3StatementExternalObject >> beNull [ ^ handle beNull diff --git a/src/SQLite3-Core/SQLite3Table.class.st b/src/SQLite3-Core/SQLite3Table.class.st index 83dc06e..c3c7b9c 100644 --- a/src/SQLite3-Core/SQLite3Table.class.st +++ b/src/SQLite3-Core/SQLite3Table.class.st @@ -2,16 +2,18 @@ A table within a SQLite3 database " Class { - #name : #SQLite3Table, - #superclass : #Object, + #name : 'SQLite3Table', + #superclass : 'Object', #instVars : [ 'database', 'properties' ], - #category : #'SQLite3-Core-Base' + #category : 'SQLite3-Core-Base', + #package : 'SQLite3-Core', + #tag : 'Base' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SQLite3Table class >> properties: aDictionary in: aDatabase [ ^ self new database: aDatabase; @@ -19,13 +21,13 @@ SQLite3Table class >> properties: aDictionary in: aDatabase [ yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Table >> columnNames [ ^ self columns collect: [:each | each name ] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Table >> columns [ ^ (self database execute: 'pragma table_info([' , self name , ']);') @@ -33,32 +35,32 @@ SQLite3Table >> columns [ rows ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Table >> database [ ^ database ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Table >> database: anObject [ database := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Table >> name [ ^ self properties at: #name ifAbsent: [ '' ] ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Table >> numberOfRows [ ^ (self database execute: 'SELECT COUNT(*) FROM [' , self name , '];') onlyValue ] -{ #category : #printing } +{ #category : 'printing' } SQLite3Table >> printOn: aStream [ super printOn: aStream. @@ -68,19 +70,19 @@ SQLite3Table >> printOn: aStream [ << '")' ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Table >> properties [ ^ properties ifNil: [ properties := Dictionary new ] ] -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3Table >> properties: anObject [ properties := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Table >> rows [ ^ (self database execute: 'SELECT * @@ -88,7 +90,7 @@ SQLite3Table >> rows [ LIMIT 1000;') rows ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3Table >> schema [ ^ self properties at: #sql ifAbsent: '' diff --git a/src/SQLite3-Core/SQLite3TooBig.class.st b/src/SQLite3-Core/SQLite3TooBig.class.st index 42ab8d5..ab474cd 100644 --- a/src/SQLite3-Core/SQLite3TooBig.class.st +++ b/src/SQLite3-Core/SQLite3TooBig.class.st @@ -4,12 +4,14 @@ The SQLITE_TOOBIG error code indicates that a string or BLOB was too large. The The SQLITE_TOOBIG error code can also result when an oversized SQL statement is passed into one of the sqlite3_prepare_v2() interfaces. The maximum length of an SQL statement defaults to a much smaller value of 1,000,000 bytes. The maximum SQL statement length can be set at compile-time using SQLITE_MAX_SQL_LENGTH or at run-time using sqlite3_limit(db,SQLITE_LIMIT_SQL_LENGTH,...). " Class { - #name : #SQLite3TooBig, - #superclass : #SQLite3NativeError, - #category : #'SQLite3-Core-Errors' + #name : 'SQLite3TooBig', + #superclass : 'SQLite3NativeError', + #category : 'SQLite3-Core-Errors', + #package : 'SQLite3-Core', + #tag : 'Errors' } -{ #category : #'private - accessing' } +{ #category : 'private - accessing' } SQLite3TooBig class >> nativeErrorCode [ ^ SQLITE_TOOBIG diff --git a/src/SQLite3-Core/package.st b/src/SQLite3-Core/package.st index 54c30b4..bc8e8d5 100644 --- a/src/SQLite3-Core/package.st +++ b/src/SQLite3-Core/package.st @@ -1 +1 @@ -Package { #name : #'SQLite3-Core' } +Package { #name : 'SQLite3-Core' } diff --git a/src/SQLite3-Inspector-Extensions/AbstractFileReference.extension.st b/src/SQLite3-Inspector-Extensions/AbstractFileReference.extension.st index 09824e7..fe7147d 100644 --- a/src/SQLite3-Inspector-Extensions/AbstractFileReference.extension.st +++ b/src/SQLite3-Inspector-Extensions/AbstractFileReference.extension.st @@ -34,14 +34,11 @@ AbstractFileReference >> inspectionSQLite3InfoContext: aContext [ ] { #category : '*SQLite3-Inspector-Extensions' } -AbstractFileReference >> inspectionSQLite3Tables [ - +AbstractFileReference >> inspectionSQLite3Tables: aBuilder [ - ^ SpTablePresenter new - items: (SQLite3Database tableInfoFor: self fullName); - addColumn: (SpStringTableColumn title: 'Table Name' evaluated: [ :assoc | assoc name ]); - addColumn: (SpStringTableColumn title: 'Number of Rows' evaluated: [ :assoc | assoc numberOfRows ]); - yourself + + ^ (SQLite3Database openOn: self fullName) inspectionSQLite3Tables: + aBuilder ] { #category : '*SQLite3-Inspector-Extensions' } From b437ec407e35705bbf817847c0d5263d6781a1b8 Mon Sep 17 00:00:00 2001 From: BernardoContreras Date: Sun, 13 Jul 2025 23:04:10 -0300 Subject: [PATCH 09/12] use builder in AbstractFileReference>>#inspectionSQLite3Info: --- .../AbstractFileReference.extension.st | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/SQLite3-Inspector-Extensions/AbstractFileReference.extension.st b/src/SQLite3-Inspector-Extensions/AbstractFileReference.extension.st index fe7147d..787b7e6 100644 --- a/src/SQLite3-Inspector-Extensions/AbstractFileReference.extension.st +++ b/src/SQLite3-Inspector-Extensions/AbstractFileReference.extension.st @@ -9,20 +9,26 @@ AbstractFileReference >> databaseSize [ ] { #category : '*SQLite3-Inspector-Extensions' } -AbstractFileReference >> inspectionSQLite3Info [ - +AbstractFileReference >> inspectionSQLite3Info: aBuilder [ - | label1 label2 | - label1 := SpLabeledPresenter - label: 'Database file:' - input: (SpTextInputFieldPresenter new text: self fullName). - label2 := SpLabeledPresenter - label: 'Database size:' - input: (SpTextInputFieldPresenter new text: self databaseSize). - ^ SpPresenter new - layout: (SpBoxLayout newTopToBottom - add: label1; - add: label2; + + | fileLabel sizeLabel | + fileLabel := (aBuilder instantiate: SpLabeledPresenter) + label: 'Database file:'; + input: (aBuilder newTextInput + text: self fullName; + yourself); + yourself. + sizeLabel := (aBuilder instantiate: SpLabeledPresenter) + label: 'Database size:'; + input: (aBuilder newTextInput + text: self databaseSize; + yourself); + yourself. + ^ aBuilder newPresenter + layout: (aBuilder newBoxLayoutTopToBottom + add: fileLabel; + add: sizeLabel; yourself); yourself ] From 062b75cfe06b7a22004c3b9c8d79de9a2286abf9 Mon Sep 17 00:00:00 2001 From: BernardoContreras Date: Sun, 13 Jul 2025 23:15:30 -0300 Subject: [PATCH 10/12] better inspection in SQLite3Row>>#inspectionSQLite3Row: --- .../SQLite3Row.extension.st | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st b/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st index 75aa570..00eafb4 100644 --- a/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st +++ b/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st @@ -4,13 +4,15 @@ Extension { #name : 'SQLite3Row' } SQLite3Row >> inspectionSQLite3Row: aBuilder [ - | presenter | - presenter := aBuilder newTable. - presenter - items: (Array with: self); - addColumns: (self columnNames collect: [ :columnName | - SpStringTableColumn - title: columnName - evaluated: [ :row | row atName: columnName ] ]). - ^ presenter + ^ aBuilder newTable + items: (self columnNames with: self values collect: [ :k :v | k -> v ]); + beResizable; + alternateRowsColor; + addColumn: (SpStringTableColumn + title: 'Column Name' + evaluated: [ :assoc | assoc key ]); + addColumn: (SpStringTableColumn + title: 'Value' + evaluated: [ :assoc | assoc value ]); + yourself ] From d237a695dc4fa3f584385cc5a74ae6731971e24b Mon Sep 17 00:00:00 2001 From: BernardoContreras Date: Mon, 14 Jul 2025 13:53:00 -0300 Subject: [PATCH 11/12] add index column to data and row inspection. --- src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st | 7 ++++++- src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st b/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st index 00eafb4..bb40880 100644 --- a/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st +++ b/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st @@ -5,9 +5,14 @@ SQLite3Row >> inspectionSQLite3Row: aBuilder [ ^ aBuilder newTable - items: (self columnNames with: self values collect: [ :k :v | k -> v ]); + items: + (self columnNames with: self values collect: [ :k :v | k -> v ]); beResizable; alternateRowsColor; + addColumn: (SpIndexTableColumn new + title: '#'; + beNotExpandable; + yourself); addColumn: (SpStringTableColumn title: 'Column Name' evaluated: [ :assoc | assoc key ]); diff --git a/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st b/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st index 0971161..fb4f921 100644 --- a/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st +++ b/src/SQLite3-Inspector-Extensions/SQLite3Table.extension.st @@ -39,6 +39,10 @@ SQLite3Table >> inspectionSQLite3Data: aBuilder [ items: self rows; beResizable; alternateRowsColor; + addColumn: (SpIndexTableColumn new + title: '#'; + beNotExpandable; + yourself); yourself. presenter addColumns: (self columnNames collect: [ :name | SpStringTableColumn From 06f411b1868ecf090ab1a2d70ee93622e67d3bc2 Mon Sep 17 00:00:00 2001 From: BernardoContreras Date: Mon, 14 Jul 2025 22:51:47 -0300 Subject: [PATCH 12/12] add SQLite3Row>>associations and use it at inspection. --- .../ManifestSQLite3CoreTests.class.st | 16 +-- .../SQLite3BaseConnectionTest.class.st | 114 +++++++++--------- .../SQLite3ColumnTest.class.st | 26 ++-- .../SQLite3ConnectionTest.class.st | 106 ++++++++-------- .../SQLite3DatabaseTest.class.st | 10 +- .../SQLite3RowTest.class.st | 41 ++++--- .../SQLite3TableBasedTest.class.st | 18 +-- .../SQLite3TableTest.class.st | 36 +++--- .../SQLite3TableWithSpacesTest.class.st | 14 ++- src/SQLite3-Core-Tests/package.st | 2 +- src/SQLite3-Core/SQLite3Row.class.st | 7 ++ .../SQLite3Row.extension.st | 3 +- 12 files changed, 214 insertions(+), 179 deletions(-) diff --git a/src/SQLite3-Core-Tests/ManifestSQLite3CoreTests.class.st b/src/SQLite3-Core-Tests/ManifestSQLite3CoreTests.class.st index 60c93c2..1a18034 100644 --- a/src/SQLite3-Core-Tests/ManifestSQLite3CoreTests.class.st +++ b/src/SQLite3-Core-Tests/ManifestSQLite3CoreTests.class.st @@ -2,28 +2,30 @@ Please describe the package using the class comment of the included manifest class. The manifest class also includes other additional metadata for the package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser " Class { - #name : #ManifestSQLite3CoreTests, - #superclass : #PackageManifest, - #category : 'SQLite3-Core-Tests-Manifest' + #name : 'ManifestSQLite3CoreTests', + #superclass : 'PackageManifest', + #category : 'SQLite3-Core-Tests-Manifest', + #package : 'SQLite3-Core-Tests', + #tag : 'Manifest' } -{ #category : #'code coverage' } +{ #category : 'code coverage' } ManifestSQLite3CoreTests class >> classNamesNotUnderTest [ ^ #( ManifestSQLite3CoreTests ) ] -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSQLite3CoreTests class >> ruleEmptyExceptionHandlerRuleV1FalsePositive [ ^ #(#(#(#RGMethodDefinition #(#SQLite3ConnectionTest #tearDown #false)) #'2022-05-10T08:25:11.111+02:00') #(#(#RGMethodDefinition #(#SQLite3BaseConnectionTest #tearDown #false)) #'2022-05-10T08:27:13.419+02:00') ) ] -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSQLite3CoreTests class >> ruleLiteralArrayContainsCommaRuleV1FalsePositive [ ^ #(#(#(#RGMethodDefinition #(#SQLite3BaseConnectionTest #deactivatedTestTracing #false)) #'2022-05-10T08:24:31.021+02:00') ) ] -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSQLite3CoreTests class >> ruleLiteralArrayContainsSuspiciousTrueFalseOrNilRuleV1FalsePositive [ ^ #(#(#(#RGMetaclassDefinition #(#'ManifestSQLite3CoreTests class' #ManifestSQLite3CoreTests)) #'2022-05-10T08:26:37.973+02:00') ) ] diff --git a/src/SQLite3-Core-Tests/SQLite3BaseConnectionTest.class.st b/src/SQLite3-Core-Tests/SQLite3BaseConnectionTest.class.st index da0b0a5..a8c2621 100644 --- a/src/SQLite3-Core-Tests/SQLite3BaseConnectionTest.class.st +++ b/src/SQLite3-Core-Tests/SQLite3BaseConnectionTest.class.st @@ -2,16 +2,18 @@ Unit tests for SQLiteBaseConnection " Class { - #name : #SQLite3BaseConnectionTest, - #superclass : #TestCase, + #name : 'SQLite3BaseConnectionTest', + #superclass : 'TestCase', #instVars : [ 'db', 'res' ], - #category : #'SQLite3-Core-Tests-Connections' + #category : 'SQLite3-Core-Tests-Connections', + #package : 'SQLite3-Core-Tests', + #tag : 'Connections' } -{ #category : #'tests - DEACTIVATED' } +{ #category : 'tests - DEACTIVATED' } SQLite3BaseConnectionTest >> deactivatedTestTracing [ | sql callback expected actual | @@ -50,7 +52,7 @@ SQLite3BaseConnectionTest >> deactivatedTestTracing [ self assert: actual contents equals: expected ] -{ #category : #private } +{ #category : 'private' } SQLite3BaseConnectionTest >> executeInDB: anSQLText [ | result | @@ -59,7 +61,7 @@ SQLite3BaseConnectionTest >> executeInDB: anSQLText [ self assert: result equals: 0 ] -{ #category : #utilities } +{ #category : 'utilities' } SQLite3BaseConnectionTest >> getTempPath [ | env | @@ -74,20 +76,20 @@ SQLite3BaseConnectionTest >> getTempPath [ (env at: 'TMPDIR' ifAbsent: ['/tmp']), '/' ] ] -{ #category : #utilities } +{ #category : 'utilities' } SQLite3BaseConnectionTest >> invalidFileNameOnCurrentOperatingSystem [ ^Smalltalk os isWindows ifTrue: [ '/&*no' ] ifFalse: [ '/nosuchfile' ] ] -{ #category : #utilities } +{ #category : 'utilities' } SQLite3BaseConnectionTest >> newUniqueFileName [ ^ self getTempPath , UUID new asString ] -{ #category : #tests } +{ #category : 'tests' } SQLite3BaseConnectionTest >> noTestColumnNamesBobbyGo [ "In this test, Bobby Tables strikes naive SQL string construction." @@ -115,7 +117,7 @@ SQLite3BaseConnectionTest >> noTestColumnNamesBobbyGo [ self assert: tables first equals: 'x' ] -{ #category : #running } +{ #category : 'running' } SQLite3BaseConnectionTest >> setUp [ super setUp. @@ -123,14 +125,14 @@ SQLite3BaseConnectionTest >> setUp [ db open ] -{ #category : #running } +{ #category : 'running' } SQLite3BaseConnectionTest >> tearDown [ [ db close ] on: SQLite3Misuse do: [ ]. super tearDown ] -{ #category : #'tests - connections' } +{ #category : 'tests - connections' } SQLite3BaseConnectionTest >> testBadOpen [ | newConnection | @@ -140,21 +142,21 @@ SQLite3BaseConnectionTest >> testBadOpen [ self deny: newConnection isOpen ] -{ #category : #'tests - execution' } +{ #category : 'tests - execution' } SQLite3BaseConnectionTest >> testBasicExecuteOk [ self executeInDB: 'create table x (xk integer, xv integer);'. self executeInDB: 'drop table x;' ] -{ #category : #'tests - execution' } +{ #category : 'tests - execution' } SQLite3BaseConnectionTest >> testBasicExecuteSyntaxError [ self should: [ db basicExecute: 'create table,;' ] raise: SQLite3AbstractError ] -{ #category : #'tests - types' } +{ #category : 'tests - types' } SQLite3BaseConnectionTest >> testBooleanColumnTypeMismatch [ self executeInDB: 'create table x (xk integer primary key, xv notboolean);'. @@ -163,7 +165,7 @@ SQLite3BaseConnectionTest >> testBooleanColumnTypeMismatch [ statement basicExecute: [ :row | self should: [ row booleanAt: 0 ] raise: SQLite3AbstractError ] ] ] -{ #category : #'tests - types' } +{ #category : 'tests - types' } SQLite3BaseConnectionTest >> testBooleanObject [ self executeInDB: 'create table x (xk integer primary key, xv boolean);'. @@ -186,7 +188,7 @@ SQLite3BaseConnectionTest >> testBooleanObject [ ] ] -{ #category : #'tests - writing' } +{ #category : 'tests - writing' } SQLite3BaseConnectionTest >> testBooleanWriteIntegerOneThenRead [ self executeInDB: 'create table x (xk integer primary key, xv boolean);'. @@ -207,7 +209,7 @@ SQLite3BaseConnectionTest >> testBooleanWriteIntegerOneThenRead [ ] ] -{ #category : #'tests - writing' } +{ #category : 'tests - writing' } SQLite3BaseConnectionTest >> testBooleanWriteIntegerTwoThenRead [ self executeInDB: 'create table x (xk integer primary key, xv boolean);'. @@ -222,7 +224,7 @@ SQLite3BaseConnectionTest >> testBooleanWriteIntegerTwoThenRead [ statement basicExecute: [ :row | self should: [ row booleanAt: 0 ] raise: SQLite3AbstractError ] ] ] -{ #category : #'tests - writing' } +{ #category : 'tests - writing' } SQLite3BaseConnectionTest >> testBooleanWriteIntegerZeroThenRead [ self executeInDB: 'create table x (xk integer primary key, xv boolean);'. @@ -243,7 +245,7 @@ SQLite3BaseConnectionTest >> testBooleanWriteIntegerZeroThenRead [ ] ] -{ #category : #'tests - writing' } +{ #category : 'tests - writing' } SQLite3BaseConnectionTest >> testBooleanWriteNilThenRead [ self executeInDB: 'create table x (xk integer primary key, xv boolean);'. @@ -265,7 +267,7 @@ SQLite3BaseConnectionTest >> testBooleanWriteNilThenRead [ ] ] -{ #category : #'tests - writing' } +{ #category : 'tests - writing' } SQLite3BaseConnectionTest >> testBooleanWriteSQLNullThenRead [ self executeInDB: 'create table x (xk integer primary key, xv boolean);'. @@ -283,7 +285,7 @@ SQLite3BaseConnectionTest >> testBooleanWriteSQLNullThenRead [ ] ] -{ #category : #'tests - writing' } +{ #category : 'tests - writing' } SQLite3BaseConnectionTest >> testBooleanWriteStringFalseThenRead [ self executeInDB: 'create table x (xk integer primary key, xv boolean);'. @@ -304,7 +306,7 @@ SQLite3BaseConnectionTest >> testBooleanWriteStringFalseThenRead [ ] ] -{ #category : #'tests - writing' } +{ #category : 'tests - writing' } SQLite3BaseConnectionTest >> testBooleanWriteStringTrueThenRead [ self executeInDB: 'create table x (xk integer primary key, xv boolean);'. @@ -325,7 +327,7 @@ SQLite3BaseConnectionTest >> testBooleanWriteStringTrueThenRead [ ] ] -{ #category : #'tests - writing' } +{ #category : 'tests - writing' } SQLite3BaseConnectionTest >> testBooleanWriteStringTwoThenRead [ self executeInDB: 'create table x (xk integer primary key, xv boolean);'. @@ -340,7 +342,7 @@ SQLite3BaseConnectionTest >> testBooleanWriteStringTwoThenRead [ statement basicExecute: [ :row | self should: [ row booleanAt: 0 ] raise: SQLite3AbstractError ] ] ] -{ #category : #'tests - writing' } +{ #category : 'tests - writing' } SQLite3BaseConnectionTest >> testBooleanWriteThenRead [ self executeInDB: 'create table x (xk integer primary key, xv boolean);'. @@ -361,7 +363,7 @@ SQLite3BaseConnectionTest >> testBooleanWriteThenRead [ ] ] -{ #category : #'tests - connections' } +{ #category : 'tests - connections' } SQLite3BaseConnectionTest >> testCloseFile [ | fileName newConnection | @@ -377,7 +379,7 @@ SQLite3BaseConnectionTest >> testCloseFile [ raise: CannotDeleteFileException ] -{ #category : #'tests - columns' } +{ #category : 'tests - columns' } SQLite3BaseConnectionTest >> testColumnNames [ | columns | @@ -389,7 +391,7 @@ SQLite3BaseConnectionTest >> testColumnNames [ self assert: columns second equals: 'xv' ] -{ #category : #'tests - columns' } +{ #category : 'tests - columns' } SQLite3BaseConnectionTest >> testColumnNamesBobbyStop [ "In this test, Bobby Tables strikes again, but fails, because #columnNamesFor: uses parameter binding." @@ -413,7 +415,7 @@ SQLite3BaseConnectionTest >> testColumnNamesBobbyStop [ self assert: tables second equals: 'students' ] -{ #category : #'tests - columns' } +{ #category : 'tests - columns' } SQLite3BaseConnectionTest >> testColumnNamesForNoSuchTableWithSpaces [ | columns | @@ -423,7 +425,7 @@ SQLite3BaseConnectionTest >> testColumnNamesForNoSuchTableWithSpaces [ self assert: columns isNil ] -{ #category : #'tests - columns' } +{ #category : 'tests - columns' } SQLite3BaseConnectionTest >> testColumnNamesForTableWithSpaces [ | columns | @@ -435,7 +437,7 @@ SQLite3BaseConnectionTest >> testColumnNamesForTableWithSpaces [ self assert: columns second equals: 'xv' ] -{ #category : #'tests - columns' } +{ #category : 'tests - columns' } SQLite3BaseConnectionTest >> testColumnNamesNoSuchTable [ | columns | @@ -445,7 +447,7 @@ SQLite3BaseConnectionTest >> testColumnNamesNoSuchTable [ self assert: columns isNil ] -{ #category : #'tests - connections' } +{ #category : 'tests - connections' } SQLite3BaseConnectionTest >> testConstraintViolation [ self @@ -454,7 +456,7 @@ SQLite3BaseConnectionTest >> testConstraintViolation [ self should: [ db basicExecute: 'insert into x values(1);' ] raise: SQLite3ConstraintViolation ] -{ #category : #'tests - execution' } +{ #category : 'tests - execution' } SQLite3BaseConnectionTest >> testDataValuesAvailable [ self executeInDB: 'create table x (xk integer primary key, iv integer, tv text);'. @@ -466,7 +468,7 @@ SQLite3BaseConnectionTest >> testDataValuesAvailable [ statement basicExecute: [ :row | self assert: row dataValuesAvailable equals: 3 ] ] ] -{ #category : #'tests - types' } +{ #category : 'tests - types' } SQLite3BaseConnectionTest >> testDate [ | data | @@ -496,7 +498,7 @@ SQLite3BaseConnectionTest >> testDate [ ] ] -{ #category : #'tests - types' } +{ #category : 'tests - types' } SQLite3BaseConnectionTest >> testDateAndTime [ | data | @@ -529,7 +531,7 @@ SQLite3BaseConnectionTest >> testDateAndTime [ ] ] -{ #category : #'tests - columns' } +{ #category : 'tests - columns' } SQLite3BaseConnectionTest >> testDeclaredColumnTypes [ | columns | @@ -542,7 +544,7 @@ SQLite3BaseConnectionTest >> testDeclaredColumnTypes [ self assert: columns third equals: 'boolean' ] -{ #category : #'tests - columns' } +{ #category : 'tests - columns' } SQLite3BaseConnectionTest >> testDeclaredColumnTypesForNoSuchTable [ | columns | @@ -551,7 +553,7 @@ SQLite3BaseConnectionTest >> testDeclaredColumnTypesForNoSuchTable [ self assert: columns isNil ] -{ #category : #'tests - columns' } +{ #category : 'tests - columns' } SQLite3BaseConnectionTest >> testDeclaredColumnTypesForNoSuchTableWithSpaces [ | columns | @@ -560,7 +562,7 @@ SQLite3BaseConnectionTest >> testDeclaredColumnTypesForNoSuchTableWithSpaces [ self assert: columns isNil ] -{ #category : #'tests - columns' } +{ #category : 'tests - columns' } SQLite3BaseConnectionTest >> testDeclaredColumnTypesForTableWithSpaces [ | columns | @@ -573,7 +575,7 @@ SQLite3BaseConnectionTest >> testDeclaredColumnTypesForTableWithSpaces [ self assert: columns third equals: 'BOOLEAN' ] -{ #category : #'tests - multilingual' } +{ #category : 'tests - multilingual' } SQLite3BaseConnectionTest >> testDefaultMultilingualStrings [ self executeInDB: @@ -590,7 +592,7 @@ SQLite3BaseConnectionTest >> testDefaultMultilingualStrings [ ] ] -{ #category : #'tests - connections' } +{ #category : 'tests - connections' } SQLite3BaseConnectionTest >> testDoubleClose [ db close. @@ -598,7 +600,7 @@ SQLite3BaseConnectionTest >> testDoubleClose [ "#tearDown will close the db again, and is similarly guarded." ] -{ #category : #'tests - types' } +{ #category : 'tests - types' } SQLite3BaseConnectionTest >> testFloat [ self executeInDB: 'create table x (xk integer primary key, xv real);'. @@ -612,7 +614,7 @@ SQLite3BaseConnectionTest >> testFloat [ ] ] -{ #category : #'tests - types' } +{ #category : 'tests - types' } SQLite3BaseConnectionTest >> testInteger [ "The large integer comes from Glorp's testInt8." @@ -632,19 +634,19 @@ SQLite3BaseConnectionTest >> testInteger [ ] ] -{ #category : #tests } +{ #category : 'tests' } SQLite3BaseConnectionTest >> testIsAbstract [ self assert: SQLite3BaseConnection isAbstract ] -{ #category : #tests } +{ #category : 'tests' } SQLite3BaseConnectionTest >> testIsThreadsafe [ self assert: (SQLite3BaseConnection isThreadsafe isKindOf: Boolean) ] -{ #category : #'tests - multilingual' } +{ #category : 'tests - multilingual' } SQLite3BaseConnectionTest >> testMultilingualStrings [ | data index | @@ -672,7 +674,7 @@ SQLite3BaseConnectionTest >> testMultilingualStrings [ ] ] -{ #category : #'tests - multilingual' } +{ #category : 'tests - multilingual' } SQLite3BaseConnectionTest >> testMultilingualTableName [ self executeInDB: 'create table 表一 (xk integer primary key, xm1 text default ''中文'');'. @@ -686,7 +688,7 @@ SQLite3BaseConnectionTest >> testMultilingualTableName [ statement basicExecute: [ :row | self assert: ( row stringAt: 0 ) equals: '中文' ] ] ] -{ #category : #'tests - types' } +{ #category : 'tests - types' } SQLite3BaseConnectionTest >> testObjectBlob [ | data | @@ -718,7 +720,7 @@ SQLite3BaseConnectionTest >> testObjectBlob [ ] ] -{ #category : #tests } +{ #category : 'tests' } SQLite3BaseConnectionTest >> testPrepareStep [ self executeInDB: 'create table x (xk integer primary key, iv integer, tv text);'. @@ -747,7 +749,7 @@ SQLite3BaseConnectionTest >> testPrepareStep [ ] ] -{ #category : #tests } +{ #category : 'tests' } SQLite3BaseConnectionTest >> testPrepareStepSelective [ | i count | @@ -781,7 +783,7 @@ SQLite3BaseConnectionTest >> testPrepareStepSelective [ self assert: count equals: 5 ] -{ #category : #tests } +{ #category : 'tests' } SQLite3BaseConnectionTest >> testResultSetColumnIntrospection [ self executeInDB: 'create table x (xk integer primary key, iv integer, tv text);'. @@ -799,7 +801,7 @@ SQLite3BaseConnectionTest >> testResultSetColumnIntrospection [ ] ] -{ #category : #'tests - types' } +{ #category : 'tests - types' } SQLite3BaseConnectionTest >> testScaledDecimal [ "This test is a simplified version of GlorpNumericTest>>tesNumeric." @@ -825,7 +827,7 @@ SQLite3BaseConnectionTest >> testScaledDecimal [ ] ] -{ #category : #'tests - tables' } +{ #category : 'tests - tables' } SQLite3BaseConnectionTest >> testTableNames [ | tables | @@ -836,7 +838,7 @@ SQLite3BaseConnectionTest >> testTableNames [ self assert: tables first equals: 'x' ] -{ #category : #'tests - tables' } +{ #category : 'tests - tables' } SQLite3BaseConnectionTest >> testTableNamesOfEmptyDatabase [ | tables | @@ -845,7 +847,7 @@ SQLite3BaseConnectionTest >> testTableNamesOfEmptyDatabase [ self assert: tables isEmpty ] -{ #category : #'tests - types' } +{ #category : 'tests - types' } SQLite3BaseConnectionTest >> testTime [ | data | @@ -875,7 +877,7 @@ SQLite3BaseConnectionTest >> testTime [ ] ] -{ #category : #private } +{ #category : 'private' } SQLite3BaseConnectionTest >> withPreparedStatement: anSQLText do: aBlock [ | statement | diff --git a/src/SQLite3-Core-Tests/SQLite3ColumnTest.class.st b/src/SQLite3-Core-Tests/SQLite3ColumnTest.class.st index b1de5f3..c135eb9 100644 --- a/src/SQLite3-Core-Tests/SQLite3ColumnTest.class.st +++ b/src/SQLite3-Core-Tests/SQLite3ColumnTest.class.st @@ -1,16 +1,18 @@ Class { - #name : #SQLite3ColumnTest, - #superclass : #TestCase, + #name : 'SQLite3ColumnTest', + #superclass : 'TestCase', #instVars : [ 'db', 'table', 'firstColumn', 'secondColumn' ], - #category : 'SQLite3-Core-Tests-Base' + #category : 'SQLite3-Core-Tests-Base', + #package : 'SQLite3-Core-Tests', + #tag : 'Base' } -{ #category : #running } +{ #category : 'running' } SQLite3ColumnTest >> setUp [ super setUp. db := SQLite3Database memory. @@ -21,7 +23,7 @@ SQLite3ColumnTest >> setUp [ secondColumn := table columns second ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3ColumnTest >> tableCreationScript [ ^'CREATE TABLE "SAMPLE" @@ -31,7 +33,7 @@ SQLite3ColumnTest >> tableCreationScript [ )' ] -{ #category : #running } +{ #category : 'running' } SQLite3ColumnTest >> tearDown [ db connection close. @@ -39,21 +41,21 @@ SQLite3ColumnTest >> tearDown [ super tearDown ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ColumnTest >> testHasNotNullConstraint [ self assert: firstColumn hasNotNullConstraint. self deny: secondColumn hasNotNullConstraint ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ColumnTest >> testIndex [ self assert: firstColumn index equals: 0. self assert: secondColumn index equals: 1 ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ColumnTest >> testInitialization [ | instance | @@ -61,21 +63,21 @@ SQLite3ColumnTest >> testInitialization [ self deny: instance hasNotNullConstraint ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ColumnTest >> testName [ self assert: firstColumn name equals: 'ID'. self assert: secondColumn name equals: 'NAME' ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ColumnTest >> testPrintString [ self assert: firstColumn printString equals: 'a SQLite3Column("ID")'. self assert: secondColumn printString equals: 'a SQLite3Column("NAME")' ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ColumnTest >> testType [ self assert: firstColumn type equals: 'INTEGER'. diff --git a/src/SQLite3-Core-Tests/SQLite3ConnectionTest.class.st b/src/SQLite3-Core-Tests/SQLite3ConnectionTest.class.st index 5b4a454..97dce36 100644 --- a/src/SQLite3-Core-Tests/SQLite3ConnectionTest.class.st +++ b/src/SQLite3-Core-Tests/SQLite3ConnectionTest.class.st @@ -2,18 +2,20 @@ Unit tests for SQLiteConnection " Class { - #name : #SQLite3ConnectionTest, - #superclass : #TestCase, + #name : 'SQLite3ConnectionTest', + #superclass : 'TestCase', #instVars : [ 'db', 'res', 'rs', 'target' ], - #category : #'SQLite3-Core-Tests-Connections' + #category : 'SQLite3-Core-Tests-Connections', + #package : 'SQLite3-Core-Tests', + #tag : 'Connections' } -{ #category : #private } +{ #category : 'private' } SQLite3ConnectionTest >> executeInDB: anSQLText [ | result | @@ -22,7 +24,7 @@ SQLite3ConnectionTest >> executeInDB: anSQLText [ self assert: result equals: 0 ] -{ #category : #utilities } +{ #category : 'utilities' } SQLite3ConnectionTest >> populateRowsInto: tableName of: database [ | rand rows schema insert rn rt | rand := Random new. @@ -42,7 +44,7 @@ SQLite3ConnectionTest >> populateRowsInto: tableName of: database [ ^ rows ] -{ #category : #running } +{ #category : 'running' } SQLite3ConnectionTest >> setUp [ super setUp. @@ -50,7 +52,7 @@ SQLite3ConnectionTest >> setUp [ db open ] -{ #category : #running } +{ #category : 'running' } SQLite3ConnectionTest >> tearDown [ [ db close ] on: SQLite3Misuse do: [ ]. @@ -58,7 +60,7 @@ SQLite3ConnectionTest >> tearDown [ super tearDown ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testBackup [ | row backup | @@ -75,7 +77,7 @@ SQLite3ConnectionTest >> testBackup [ self assert: (row at: 3) equals: '1-ZZZ' ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testChanges [ | count | count := self populateRowsInto: 'stuff' of: db. @@ -84,7 +86,7 @@ SQLite3ConnectionTest >> testChanges [ self assert: db changes equals: count ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testDo [ | arrayResults dictResults | @@ -120,7 +122,7 @@ SQLite3ConnectionTest >> testDo [ self assert: dictResults third equals: { ('id' -> 30). ('tv' -> 'ghi') } asDictionary ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExactlyOneRow [ | row | @@ -133,7 +135,7 @@ SQLite3ConnectionTest >> testExactlyOneRow [ self assert: (row at: 3) equals: '1-ZZZ' ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExactlyOneRowGotNone [ | row | @@ -142,7 +144,7 @@ SQLite3ConnectionTest >> testExactlyOneRowGotNone [ self assert: row isNil ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteDelete [ self executeInDB: 'create table if not exists x (xk integer primary key, iv integer, tv text);'. @@ -152,7 +154,7 @@ SQLite3ConnectionTest >> testExecuteDelete [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteDrop [ self executeInDB: 'create table if not exists x (xk integer primary key, iv integer, tv text);'. @@ -161,7 +163,7 @@ SQLite3ConnectionTest >> testExecuteDrop [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteNoResult [ rs := db execute: 'create table if not exists x (xk integer primary key, iv integer, tv text);'. @@ -177,7 +179,7 @@ SQLite3ConnectionTest >> testExecuteNoResult [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteValueInsertArray [ | rd | @@ -206,7 +208,7 @@ SQLite3ConnectionTest >> testExecuteValueInsertArray [ self assert: rd last equals: 'two' ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteValueInsertBooleanNilThenSelect [ | row | @@ -236,7 +238,7 @@ SQLite3ConnectionTest >> testExecuteValueInsertBooleanNilThenSelect [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteValueInsertBooleanThenSelect [ | row | @@ -266,7 +268,7 @@ SQLite3ConnectionTest >> testExecuteValueInsertBooleanThenSelect [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteValueInsertChanges [ self executeInDB: 'create table if not exists x (xk integer primary key, iv integer, tv text);'. @@ -295,7 +297,7 @@ SQLite3ConnectionTest >> testExecuteValueInsertChanges [ self assert: db totalChanges equals: 2 ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteValueInsertThenSelect [ | row | @@ -327,7 +329,7 @@ SQLite3ConnectionTest >> testExecuteValueInsertThenSelect [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteValueInsertThenSelect2 [ | row | @@ -372,7 +374,7 @@ SQLite3ConnectionTest >> testExecuteValueInsertThenSelect2 [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteValueInsertThenSelectDateTime [ | row data | @@ -406,7 +408,7 @@ SQLite3ConnectionTest >> testExecuteValueInsertThenSelectDateTime [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithAllInsertManyValues [ | results | @@ -436,7 +438,7 @@ SQLite3ConnectionTest >> testExecuteWithAllInsertManyValues [ self assert: results third equals: #( 3 'four' ) ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithAllUpdateManyValues [ | results | @@ -478,7 +480,7 @@ SQLite3ConnectionTest >> testExecuteWithAllUpdateManyValues [ self assert: results third equals: #( 3 'seven' ) ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithInsertArray [ | rd | @@ -507,7 +509,7 @@ SQLite3ConnectionTest >> testExecuteWithInsertArray [ self assert: rd last equals: 'two' ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithInsertBooleanNilThenSelect [ | row | @@ -537,7 +539,7 @@ SQLite3ConnectionTest >> testExecuteWithInsertBooleanNilThenSelect [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithInsertBooleanSQLNullThenSelect [ | row | @@ -567,7 +569,7 @@ SQLite3ConnectionTest >> testExecuteWithInsertBooleanSQLNullThenSelect [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithInsertBooleanThenSelect [ | row | @@ -597,7 +599,7 @@ SQLite3ConnectionTest >> testExecuteWithInsertBooleanThenSelect [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithInsertChanges [ self executeInDB: 'create table if not exists x (xk integer primary key, iv integer, tv text);'. @@ -627,7 +629,7 @@ SQLite3ConnectionTest >> testExecuteWithInsertChanges [ self assert: db totalChanges equals: 2 ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithInsertDictionary [ | rd | @@ -658,7 +660,7 @@ SQLite3ConnectionTest >> testExecuteWithInsertDictionary [ self assert: rd last equals: '2' ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithInsertMultilingualStringsThenSelect [ | data s row idx | @@ -688,7 +690,7 @@ SQLite3ConnectionTest >> testExecuteWithInsertMultilingualStringsThenSelect [ self assert: idx equals: 4 ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithInsertNoDataThenSelect [ | row | @@ -715,7 +717,7 @@ SQLite3ConnectionTest >> testExecuteWithInsertNoDataThenSelect [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithInsertThenSelect [ | row | @@ -747,7 +749,7 @@ SQLite3ConnectionTest >> testExecuteWithInsertThenSelect [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithInsertThenSelect2 [ | row | @@ -792,7 +794,7 @@ SQLite3ConnectionTest >> testExecuteWithInsertThenSelect2 [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithInsertThenSelect3 [ | s row idx | @@ -828,7 +830,7 @@ SQLite3ConnectionTest >> testExecuteWithInsertThenSelect3 [ self assert: idx equals: 6 ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithInsertThenSelectChineseTableName [ | data s row idx | @@ -858,7 +860,7 @@ SQLite3ConnectionTest >> testExecuteWithInsertThenSelectChineseTableName [ self assert: idx equals: 4 ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithInsertThenSelectDateTime [ | row data | @@ -892,7 +894,7 @@ SQLite3ConnectionTest >> testExecuteWithInsertThenSelectDateTime [ rs close ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithInsertThenSelectJapaneseTableName [ | data s row idx | @@ -922,7 +924,7 @@ SQLite3ConnectionTest >> testExecuteWithInsertThenSelectJapaneseTableName [ self assert: idx equals: 4 ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithToFail [ self executeInDB: 'create table if not exists x (xk integer primary key, iv integer, tv text);'. @@ -939,7 +941,7 @@ SQLite3ConnectionTest >> testExecuteWithToFail [ self assert: res equals: 0 ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testExecuteWithToFail2 [ self executeInDB: 'create table if not exists x (xk integer primary key, iv integer, tv text);'. @@ -956,7 +958,7 @@ SQLite3ConnectionTest >> testExecuteWithToFail2 [ self assert: res equals: 0 ] -{ #category : #'tests - open / close' } +{ #category : 'tests - open / close' } SQLite3ConnectionTest >> testForcedClose [ | fileRef conn | @@ -982,7 +984,7 @@ SQLite3ConnectionTest >> testForcedClose [ self assert: fileRef exists not ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testGetAutocommit [ self assert: db getAutoCommit equals: true. @@ -992,7 +994,7 @@ SQLite3ConnectionTest >> testGetAutocommit [ self assert: db getAutoCommit equals: true ] -{ #category : #'tests - glorp compatibility' } +{ #category : 'tests - glorp compatibility' } SQLite3ConnectionTest >> testGlorpAutoID [ | schema rows | @@ -1015,7 +1017,7 @@ SQLite3ConnectionTest >> testGlorpAutoID [ self assert: (rows first at: 'STUFF') equals: 'The Bad Beginning' ] -{ #category : #'tests - glorp compatibility' } +{ #category : 'tests - glorp compatibility' } SQLite3ConnectionTest >> testGlorpCompositeKey [ | schema rows | @@ -1036,7 +1038,7 @@ SQLite3ConnectionTest >> testGlorpCompositeKey [ self assert: (rows first at: 'NAME') equals: 'User One' ] -{ #category : #'tests - glorp compatibility' } +{ #category : 'tests - glorp compatibility' } SQLite3ConnectionTest >> testGlorpDoubleInsertPrimaryKey [ | schema rows | @@ -1058,7 +1060,7 @@ SQLite3ConnectionTest >> testGlorpDoubleInsertPrimaryKey [ self assert: (rows first at: 'NAME') equals: 'Fred' ] -{ #category : #'tests - glorp compatibility' } +{ #category : 'tests - glorp compatibility' } SQLite3ConnectionTest >> testGlorpUpdate [ | schema rows | @@ -1081,7 +1083,7 @@ SQLite3ConnectionTest >> testGlorpUpdate [ self assert: (rows first at: 'COPIES_IN_STOCK') equals: 6 ] -{ #category : #'tests - glorp compatibility' } +{ #category : 'tests - glorp compatibility' } SQLite3ConnectionTest >> testGlorpUpdateTwice [ | schema rows | @@ -1105,7 +1107,7 @@ SQLite3ConnectionTest >> testGlorpUpdateTwice [ self assert: (rows first at: 'COPIES_IN_STOCK') equals: 6 ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testInsertThenSelectInTransaction [ "From GlorpDatabaseBasicTest>>testNameBinding." @@ -1127,7 +1129,7 @@ SQLite3ConnectionTest >> testInsertThenSelectInTransaction [ self assert: res equals: 0 ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testRows [ "SQLite uses 1-based column indexing for database rows." @@ -1159,7 +1161,7 @@ SQLite3ConnectionTest >> testRows [ self assert: ( rows last at: 3 ) equals: rowCount asString , '-ZZZ' ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testStatementReadOnly [ | stmt | @@ -1171,7 +1173,7 @@ SQLite3ConnectionTest >> testStatementReadOnly [ self assert: stmt isReadOnly equals: false ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> testValueInsertThenSelectInTransaction [ "From GlorpDatabaseBasicTest>>testNameBinding." @@ -1193,7 +1195,7 @@ SQLite3ConnectionTest >> testValueInsertThenSelectInTransaction [ self assert: res equals: 0 ] -{ #category : #tests } +{ #category : 'tests' } SQLite3ConnectionTest >> untestStatementInProgress [ "XXX Doesn't work yet." | s1 s2 | diff --git a/src/SQLite3-Core-Tests/SQLite3DatabaseTest.class.st b/src/SQLite3-Core-Tests/SQLite3DatabaseTest.class.st index 4e19070..47dcf56 100644 --- a/src/SQLite3-Core-Tests/SQLite3DatabaseTest.class.st +++ b/src/SQLite3-Core-Tests/SQLite3DatabaseTest.class.st @@ -2,12 +2,14 @@ A test class for `SQLite3Database` " Class { - #name : #SQLite3DatabaseTest, - #superclass : #TestCase, - #category : 'SQLite3-Core-Tests-Base' + #name : 'SQLite3DatabaseTest', + #superclass : 'TestCase', + #category : 'SQLite3-Core-Tests-Base', + #package : 'SQLite3-Core-Tests', + #tag : 'Base' } -{ #category : #tests } +{ #category : 'tests' } SQLite3DatabaseTest >> testPrintString [ self assert: SQLite3Database memory printString equals: 'a SQLite3Database(":memory:")' diff --git a/src/SQLite3-Core-Tests/SQLite3RowTest.class.st b/src/SQLite3-Core-Tests/SQLite3RowTest.class.st index 6f3cf13..2596b2d 100644 --- a/src/SQLite3-Core-Tests/SQLite3RowTest.class.st +++ b/src/SQLite3-Core-Tests/SQLite3RowTest.class.st @@ -2,16 +2,18 @@ Unit tests for SQLite3Row " Class { - #name : #SQLite3RowTest, - #superclass : #TestCase, + #name : 'SQLite3RowTest', + #superclass : 'TestCase', #instVars : [ 'filledRow', 'emptyRow' ], - #category : 'SQLite3-Core-Tests-Database' + #category : 'SQLite3-Core-Tests-Database', + #package : 'SQLite3-Core-Tests', + #tag : 'Database' } -{ #category : #running } +{ #category : 'running' } SQLite3RowTest >> setUp [ super setUp. emptyRow := SQLite3Row new. @@ -22,14 +24,14 @@ SQLite3RowTest >> setUp [ at: 'pi' put: '3.14' ] -{ #category : #tests } +{ #category : 'tests' } SQLite3RowTest >> testAsArray [ self assert: emptyRow asArray equals: #(). self assert: filledRow asArray equals: #(1 true '3.14') ] -{ #category : #tests } +{ #category : 'tests' } SQLite3RowTest >> testAsCombinedDictionary [ | dict | dict := Dictionary new. @@ -43,7 +45,7 @@ SQLite3RowTest >> testAsCombinedDictionary [ self assert: filledRow asCombinedDictionary equals: dict ] -{ #category : #tests } +{ #category : 'tests' } SQLite3RowTest >> testAsDictionary [ | dict | dict := Dictionary new. @@ -55,7 +57,18 @@ SQLite3RowTest >> testAsDictionary [ self assert: filledRow asDictionary equals: dict ] -{ #category : #tests } +{ #category : 'tests' } +SQLite3RowTest >> testAssociations [ + + self assert: emptyRow associations isEmpty. + self assert: emptyRow associations equals: #( ). + self assert: filledRow associations equals: { + ('foo' -> 1). + ('bar' -> true). + ('pi' -> '3.14') } +] + +{ #category : 'tests' } SQLite3RowTest >> testColumnAccessingIfAbsent [ |blockExecutedFlag| blockExecutedFlag := false. @@ -69,13 +82,13 @@ SQLite3RowTest >> testColumnAccessingIfAbsent [ self assert: blockExecutedFlag ] -{ #category : #tests } +{ #category : 'tests' } SQLite3RowTest >> testColumnAccessingOnEmptyRow [ self assert: (emptyRow at: 'foo') equals: nil ] -{ #category : #tests } +{ #category : 'tests' } SQLite3RowTest >> testColumnAccessingOnFilledRow [ self assert: (filledRow at: 'foo') equals: 1. @@ -85,19 +98,19 @@ SQLite3RowTest >> testColumnAccessingOnFilledRow [ self assert: (filledRow at: 'nope') equals: nil ] -{ #category : #tests } +{ #category : 'tests' } SQLite3RowTest >> testColumnNamesOnEmptyRow [ self assert: emptyRow columnNames equals: #() ] -{ #category : #tests } +{ #category : 'tests' } SQLite3RowTest >> testColumnNamesOnFilledRow [ self assert: filledRow columnNames equals: #('foo' 'bar' 'pi') ] -{ #category : #tests } +{ #category : 'tests' } SQLite3RowTest >> testColumnPuttingOnEmptyRow [ self assert: (emptyRow at: 'foo') equals: nil. @@ -107,7 +120,7 @@ SQLite3RowTest >> testColumnPuttingOnEmptyRow [ self assert: (emptyRow at: 'foo') equals: 42 ] -{ #category : #tests } +{ #category : 'tests' } SQLite3RowTest >> testColumnPuttingOnFilledRow [ self assert: (filledRow at: 'foo') equals: 1. diff --git a/src/SQLite3-Core-Tests/SQLite3TableBasedTest.class.st b/src/SQLite3-Core-Tests/SQLite3TableBasedTest.class.st index f7735e3..efd865f 100644 --- a/src/SQLite3-Core-Tests/SQLite3TableBasedTest.class.st +++ b/src/SQLite3-Core-Tests/SQLite3TableBasedTest.class.st @@ -1,20 +1,22 @@ Class { - #name : #SQLite3TableBasedTest, - #superclass : #TestCase, + #name : 'SQLite3TableBasedTest', + #superclass : 'TestCase', #instVars : [ 'db', 'table' ], - #category : #'SQLite3-Core-Tests-Base' + #category : 'SQLite3-Core-Tests-Base', + #package : 'SQLite3-Core-Tests', + #tag : 'Base' } -{ #category : #testing } +{ #category : 'testing' } SQLite3TableBasedTest class >> isAbstract [ ^ self == SQLite3TableBasedTest ] -{ #category : #running } +{ #category : 'running' } SQLite3TableBasedTest >> setUp [ super setUp. db := SQLite3Database memory. @@ -23,20 +25,20 @@ SQLite3TableBasedTest >> setUp [ table := db tables first ] -{ #category : #accessing } +{ #category : 'accessing' } SQLite3TableBasedTest >> tableCreationScript [ ^ self subclassResponsibility ] -{ #category : #running } +{ #category : 'running' } SQLite3TableBasedTest >> tearDown [ db connection close. db := nil. super tearDown ] -{ #category : #'tests - sample' } +{ #category : 'tests - sample' } SQLite3TableBasedTest >> testSampleTableSchema [ self assert: table schema equals: self tableCreationScript diff --git a/src/SQLite3-Core-Tests/SQLite3TableTest.class.st b/src/SQLite3-Core-Tests/SQLite3TableTest.class.st index 8fbac8c..d875bc1 100644 --- a/src/SQLite3-Core-Tests/SQLite3TableTest.class.st +++ b/src/SQLite3-Core-Tests/SQLite3TableTest.class.st @@ -2,12 +2,14 @@ A test class for `SQLite3Table` " Class { - #name : #SQLite3TableTest, - #superclass : #SQLite3TableBasedTest, - #category : #'SQLite3-Core-Tests-Base' + #name : 'SQLite3TableTest', + #superclass : 'SQLite3TableBasedTest', + #category : 'SQLite3-Core-Tests-Base', + #package : 'SQLite3-Core-Tests', + #tag : 'Base' } -{ #category : #accessing } +{ #category : 'accessing' } SQLite3TableTest >> tableCreationScript [ ^'CREATE TABLE "SAMPLE" @@ -17,7 +19,7 @@ SQLite3TableTest >> tableCreationScript [ )' ] -{ #category : #tests } +{ #category : 'tests' } SQLite3TableTest >> testName [ | properties instance | @@ -26,13 +28,13 @@ SQLite3TableTest >> testName [ self assert: instance name equals: 'SimpleTable' ] -{ #category : #'tests - sample' } +{ #category : 'tests - sample' } SQLite3TableTest >> testNumberOfRows [ self assert: table numberOfRows equals: 0 ] -{ #category : #'tests - sample' } +{ #category : 'tests - sample' } SQLite3TableTest >> testNumberOfRowsIsOne [ db execute: 'INSERT INTO SAMPLE(NAME) VALUES (''first example'');'. @@ -40,7 +42,7 @@ SQLite3TableTest >> testNumberOfRowsIsOne [ self assert: table numberOfRows equals: 1 ] -{ #category : #'tests - sample' } +{ #category : 'tests - sample' } SQLite3TableTest >> testNumberOfRowsIsTwo [ db execute: 'INSERT INTO SAMPLE(NAME) VALUES (''first example''), (''second example'');'. @@ -48,19 +50,19 @@ SQLite3TableTest >> testNumberOfRowsIsTwo [ self assert: table numberOfRows equals: 2 ] -{ #category : #tests } +{ #category : 'tests' } SQLite3TableTest >> testPrintString [ self assert: table printString equals: 'a SQLite3Table("SAMPLE")' ] -{ #category : #'tests - sample' } +{ #category : 'tests - sample' } SQLite3TableTest >> testRows [ self assert: table rows isEmpty ] -{ #category : #'tests - sample' } +{ #category : 'tests - sample' } SQLite3TableTest >> testRowsHasOneRow [ | rows | @@ -71,7 +73,7 @@ SQLite3TableTest >> testRowsHasOneRow [ self assert: (rows first at: 'NAME') equals: 'first example' ] -{ #category : #'tests - sample' } +{ #category : 'tests - sample' } SQLite3TableTest >> testRowsHasTwoRows [ | rows | @@ -84,25 +86,25 @@ SQLite3TableTest >> testRowsHasTwoRows [ self assert: (rows second at: 'NAME') equals: 'second example' ] -{ #category : #'tests - sample' } +{ #category : 'tests - sample' } SQLite3TableTest >> testSampleTable [ self assert: table name equals: 'SAMPLE' ] -{ #category : #'tests - sample' } +{ #category : 'tests - sample' } SQLite3TableTest >> testSampleTableColumnNames [ self assert: table columnNames size equals: 2 ] -{ #category : #'tests - sample' } +{ #category : 'tests - sample' } SQLite3TableTest >> testSampleTableColumns [ self assert: table columns size equals: 2 ] -{ #category : #'tests - sample' } +{ #category : 'tests - sample' } SQLite3TableTest >> testSampleTableProperties [ |props| props := table properties. @@ -115,7 +117,7 @@ SQLite3TableTest >> testSampleTableProperties [ self assert: (props at: #sql) equals: self tableCreationScript ] -{ #category : #tests } +{ #category : 'tests' } SQLite3TableTest >> testUnitializedName [ self assert: SQLite3Table new name equals: '' diff --git a/src/SQLite3-Core-Tests/SQLite3TableWithSpacesTest.class.st b/src/SQLite3-Core-Tests/SQLite3TableWithSpacesTest.class.st index 488a2d1..52bfb84 100644 --- a/src/SQLite3-Core-Tests/SQLite3TableWithSpacesTest.class.st +++ b/src/SQLite3-Core-Tests/SQLite3TableWithSpacesTest.class.st @@ -1,10 +1,12 @@ Class { - #name : #SQLite3TableWithSpacesTest, - #superclass : #SQLite3TableBasedTest, - #category : #'SQLite3-Core-Tests-Base' + #name : 'SQLite3TableWithSpacesTest', + #superclass : 'SQLite3TableBasedTest', + #category : 'SQLite3-Core-Tests-Base', + #package : 'SQLite3-Core-Tests', + #tag : 'Base' } -{ #category : #accessing } +{ #category : 'accessing' } SQLite3TableWithSpacesTest >> tableCreationScript [ ^'CREATE TABLE "ANOTHER TABLE" @@ -14,14 +16,14 @@ SQLite3TableWithSpacesTest >> tableCreationScript [ )' ] -{ #category : #tests } +{ #category : 'tests' } SQLite3TableWithSpacesTest >> testColumnNameHasSpace [ self assert: table columnNames size equals: 2. self assert: table columnNames second equals: 'SOME NAME' ] -{ #category : #tests } +{ #category : 'tests' } SQLite3TableWithSpacesTest >> testPrintStringHasTableNameWithSpace [ self assert: table printString equals: 'a SQLite3Table("ANOTHER TABLE")' diff --git a/src/SQLite3-Core-Tests/package.st b/src/SQLite3-Core-Tests/package.st index 6b809ac..a82cce1 100644 --- a/src/SQLite3-Core-Tests/package.st +++ b/src/SQLite3-Core-Tests/package.st @@ -1 +1 @@ -Package { #name : #'SQLite3-Core-Tests' } +Package { #name : 'SQLite3-Core-Tests' } diff --git a/src/SQLite3-Core/SQLite3Row.class.st b/src/SQLite3-Core/SQLite3Row.class.st index 7e19bb6..f652055 100644 --- a/src/SQLite3-Core/SQLite3Row.class.st +++ b/src/SQLite3-Core/SQLite3Row.class.st @@ -41,6 +41,13 @@ SQLite3Row >> asDictionary [ ^ dict ] +{ #category : 'converting' } +SQLite3Row >> associations [ + + ^ Array new: self size streamContents: [ :stream | + self columnNames with: self values do: [ :columnName :columnValue | stream nextPut: columnName -> columnValue ] ] +] + { #category : 'accessing' } SQLite3Row >> at: aKey [ ^ self at: aKey ifAbsent: [ ] diff --git a/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st b/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st index bb40880..d82a24a 100644 --- a/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st +++ b/src/SQLite3-Inspector-Extensions/SQLite3Row.extension.st @@ -5,8 +5,7 @@ SQLite3Row >> inspectionSQLite3Row: aBuilder [ ^ aBuilder newTable - items: - (self columnNames with: self values collect: [ :k :v | k -> v ]); + items: self associations; beResizable; alternateRowsColor; addColumn: (SpIndexTableColumn new