Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/SQLite3-Core/FFIExternalReference.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #FFIExternalReference }
Extension { #name : 'FFIExternalReference' }

{ #category : #'*SQLite3-Core' }
{ #category : '*SQLite3-Core' }
FFIExternalReference >> manualRelease [
FFIExternalResourceManager uniqueInstance removeResource: self
]
4 changes: 2 additions & 2 deletions src/SQLite3-Core/FFIExternalResourceManager.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #FFIExternalResourceManager }
Extension { #name : 'FFIExternalResourceManager' }

{ #category : #'*SQLite3-Core' }
{ #category : '*SQLite3-Core' }
FFIExternalResourceManager >> removeResource: anObject [
registry remove: anObject ifAbsent: [ ]
]
10 changes: 6 additions & 4 deletions src/SQLite3-Core/SQLite3Abort.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions src/SQLite3-Core/SQLite3AbortRollback.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions src/SQLite3-Core/SQLite3AbstractError.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
10 changes: 6 additions & 4 deletions src/SQLite3-Core/SQLite3AuthorizationDenied.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 23 additions & 21 deletions src/SQLite3-Core/SQLite3Backup.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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;
Expand All @@ -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: [
Expand All @@ -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.
Expand All @@ -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
Expand Down
10 changes: 6 additions & 4 deletions src/SQLite3-Core/SQLite3BackupExternalReference.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading