Skip to content

Commit

Permalink
doc: document SQLite3::Constants
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Apr 16, 2024
1 parent 055da73 commit 92e5c16
Showing 1 changed file with 97 additions and 27 deletions.
124 changes: 97 additions & 27 deletions lib/sqlite3/constants.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
module SQLite3
module Constants
#
# CAPI3REF: Text Encodings
#
# These constant define integer codes that represent the various
# text encodings supported by SQLite.
#
module TextRep
# IMP: R-37514-35566
UTF8 = 1
# IMP: R-03371-37637
UTF16LE = 2
# IMP: R-51971-34154
UTF16BE = 3
# Use native byte order
UTF16 = 4
# Deprecated
ANY = 5
# sqlite3_create_collation only
DETERMINISTIC = 0x800
end

#
# CAPI3REF: Fundamental Datatypes
#
# ^(Every value in SQLite has one of five fundamental datatypes:
#
# <ul>
# <li> 64-bit signed integer
# <li> 64-bit IEEE floating point number
# <li> string
# <li> BLOB
# <li> NULL
# </ul>)^
#
# These constants are codes for each of those types.
#
module ColumnType
INTEGER = 1
FLOAT = 2
Expand All @@ -17,34 +44,77 @@ module ColumnType
NULL = 5
end

#
# CAPI3REF: Result Codes
#
# Many SQLite functions return an integer result code from the set shown
# here in order to indicate success or failure.
#
# New error codes may be added in future versions of SQLite.
#
module ErrorCode
OK = 0 # Successful result
ERROR = 1 # SQL error or missing database
INTERNAL = 2 # An internal logic error in SQLite
PERM = 3 # Access permission denied
ABORT = 4 # Callback routine requested an abort
BUSY = 5 # The database file is locked
LOCKED = 6 # A table in the database is locked
NOMEM = 7 # A malloc() failed
READONLY = 8 # Attempt to write a readonly database
INTERRUPT = 9 # Operation terminated by sqlite_interrupt()
IOERR = 10 # Some kind of disk I/O error occurred
CORRUPT = 11 # The database disk image is malformed
NOTFOUND = 12 # (Internal Only) Table or record not found
FULL = 13 # Insertion failed because database is full
CANTOPEN = 14 # Unable to open the database file
PROTOCOL = 15 # Database lock protocol error
EMPTY = 16 # (Internal Only) Database table is empty
SCHEMA = 17 # The database schema changed
TOOBIG = 18 # Too much data for one row of a table
CONSTRAINT = 19 # Abort due to constraint violation
MISMATCH = 20 # Data type mismatch
MISUSE = 21 # Library used incorrectly
NOLFS = 22 # Uses OS features not supported on host
AUTH = 23 # Authorization denied

ROW = 100 # sqlite_step() has another row ready
DONE = 101 # sqlite_step() has finished executing
# Successful result
OK = 0
# SQL error or missing database
ERROR = 1
# An internal logic error in SQLite
INTERNAL = 2
# Access permission denied
PERM = 3
# Callback routine requested an abort
ABORT = 4
# The database file is locked
BUSY = 5
# A table in the database is locked
LOCKED = 6
# A malloc() failed
NOMEM = 7
# Attempt to write a readonly database
READONLY = 8
# Operation terminated by sqlite_interrupt()
INTERRUPT = 9
# Some kind of disk I/O error occurred
IOERR = 10
# The database disk image is malformed
CORRUPT = 11
# (Internal Only) Table or record not found
NOTFOUND = 12
# Insertion failed because database is full
FULL = 13
# Unable to open the database file
CANTOPEN = 14
# Database lock protocol error
PROTOCOL = 15
# (Internal Only) Database table is empty
EMPTY = 16
# The database schema changed
SCHEMA = 17
# Too much data for one row of a table
TOOBIG = 18
# Abort due to constraint violation
CONSTRAINT = 19
# Data type mismatch
MISMATCH = 20
# Library used incorrectly
MISUSE = 21
# Uses OS features not supported on host
NOLFS = 22
# Authorization denied
AUTH = 23
# Not used
FORMAT = 24
# 2nd parameter to sqlite3_bind out of range
RANGE = 25
# File opened that is not a database file
NOTADB = 26
# Notifications from sqlite3_log()
NOTICE = 27
# Warnings from sqlite3_log()
WARNING = 28
# sqlite_step() has another row ready
ROW = 100
# sqlite_step() has finished executing
DONE = 101
end
end
end

0 comments on commit 92e5c16

Please sign in to comment.