Class SqliteStore
- Author:
- gmt2001
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated, for removal: This API element is subject to removal in a future version.Creates a new tablevoid
AddFile
(Connection connection, String fName) Deprecated, for removal: This API element is subject to removal in a future version.void
Deprecated, for removal: This API element is subject to removal in a future version.Backs up the database to the specified filename in thedbbackup
folderboolean
Deprecated, for removal: This API element is subject to removal in a future version.Indicates if this database type supports generating backup filesvoid
Deprecated, for removal: This API element is subject to removal in a future version.Ensures that all tables created withDataStore.AddFile(String)
have aUNIQUE
index across thesection
andvariable
columnsstatic void
CreateIndexes
(Connection connection) Deprecated, for removal: This API element is subject to removal in a future version.void
dispose()
Deprecated, for removal: This API element is subject to removal in a future version.Cleanup open connectionsvoid
Deprecated, for removal: This API element is subject to removal in a future version.void
Deprecated, for removal: This API element is subject to removal in a future version.Drops allUNIQUE
indexes from tables created withDataStore.AddFile(String)
static void
DropIndexes
(Connection connection) Deprecated, for removal: This API element is subject to removal in a future version.boolean
FileExists
(String fName) Deprecated, for removal: This API element is subject to removal in a future version.Indicates if the given table already existsboolean
FileExists
(Connection connection, String fName) Deprecated, for removal: This API element is subject to removal in a future version.String[]
GetCategoryList
(String fName) Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of all values in thesection
column within the tableString[]
Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of tables in the database.GetKeyByValue
(String fName, String section, String value) Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of thevariable
column for the given table, section, and valueString[]
GetKeyList
(String fName, String section) Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of all values in thevariable
column within the table and sectionString[]
GetKeysByLikeKeys
(String fName, String section, String search) Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of values in thevariable
column within the table and section, where the value of thevariable
column contains the search phraseString[]
GetKeysByLikeKeysOrder
(String fName, String section, String search, String order, String limit, String offset) Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of values in thevariable
column within the table and section, where the value of thevariable
column contains the search phrase, sorted naturallyString[]
GetKeysByLikeValues
(String fName, String section, String search) Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of values in thevariable
column within the table and section, where the value of thevalue
column contains the search phraseString[]
Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of values in thevariable
column within the table and section, sorted naturally as integersString[]
Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of values in thevariable
column within the table and section, sorted naturally by thevalue
column as integersString[]
Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of values in thevariable
column within the table and section, sorted naturallyString[]
Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of values in thevariable
column within the table and section, sorted naturally by thevalue
columnKeyValue[]
GetKeyValueList
(String fName, String section) Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of allvariable/value
pairs within the table and sectionDeprecated, for removal: This API element is subject to removal in a future version.Returns the value of thevalue
column for the given table, section, and key as a stringstatic boolean
hasDatabase
(String configStr) Deprecated, for removal: This API element is subject to removal in a future version.boolean
Deprecated, for removal: This API element is subject to removal in a future version.Indicates if the given table contains a row matching the given section and keyvoid
IncreaseBatchString
(String fName, String section, String[] keys, String value) Deprecated, for removal: This API element is subject to removal in a future version.Increases the value of thevalue
column as an integer for all keys of the given table and sectionstatic SqliteStore
instance()
Deprecated, for removal: This API element is subject to removal in a future version.static SqliteStore
Deprecated, for removal: This API element is subject to removal in a future version.static boolean
isAvailable
(String configStr) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Executes an SQL queryvoid
RemoveFile
(String fName) Deprecated, for removal: This API element is subject to removal in a future version.Deletes the tablevoid
Deprecated, for removal: This API element is subject to removal in a future version.Deletes the row that matches the given table, section, and keyvoid
RemoveSection
(String fName, String section) Deprecated, for removal: This API element is subject to removal in a future version.Deletes all rows that match the given table and sectionvoid
RenameFile
(String fNameSource, String fNameDest) Deprecated, for removal: This API element is subject to removal in a future version.Renames the tablevoid
SetBatchString
(String fName, String section, String[] keys, String[] values) Deprecated, for removal: This API element is subject to removal in a future version.Performs a bulkDataStore.SetString(String, String, String, String)
operation, using available database features to do so more efficiently.void
Deprecated, for removal: This API element is subject to removal in a future version.Sets the value of thevalue
column for the given table, section, and key as a stringMethods inherited from class com.gmt2001.datastore.DataStore
CanConnect, decr, decr, decrD, decrD, decrF, decrF, decrL, decrL, del, dsl, executeSql, exists, field, findTable, get, GetBoolean, GetBoolean, GetDouble, GetDouble, GetFloat, GetFloat, GetInteger, GetInteger, GetKeysByLikeKeysOrder, GetKeysByLikeKeysOrder, GetKeysByLikeKeysOrder, GetKeysByNumberOrder, GetKeysByNumberOrder, GetKeysByNumberOrder, GetKeysByNumberOrderValue, GetKeysByNumberOrderValue, GetKeysByNumberOrderValue, GetKeysByOrder, GetKeysByOrder, GetKeysByOrder, GetKeysByOrderValue, GetKeysByOrderValue, GetKeysByOrderValue, GetLong, GetLong, GetString, incr, incr, incrD, incrD, incrF, incrF, incrL, incrL, InsertString, OptBoolean, OptDouble, OptFloat, OptInteger, OptLong, OptRecord, OptRecord, OptString, resolveClassname, searchByKey, searchByValue, set, setbatch, SetBoolean, SetDouble, SetFloat, SetInteger, SetLong
-
Method Details
-
instance
Deprecated, for removal: This API element is subject to removal in a future version. -
instance
Deprecated, for removal: This API element is subject to removal in a future version. -
isAvailable
Deprecated, for removal: This API element is subject to removal in a future version. -
hasDatabase
Deprecated, for removal: This API element is subject to removal in a future version. -
AddFile
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Creates a new table -
AddFile
Deprecated, for removal: This API element is subject to removal in a future version. -
RemoveKey
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Deletes the row that matches the given table, section, and keyIf
section
is null, deletes all rows with a matching table and key, regardless of section -
RemoveSection
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Deletes all rows that match the given table and section- Overrides:
RemoveSection
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefixsection
- a section name.""
(empty string) for the default section
-
RemoveFile
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Deletes the table- Overrides:
RemoveFile
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefix
-
RenameFile
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Renames the table- Overrides:
RenameFile
in classDataStore
- Parameters:
fNameSource
- a table name for an existing table, without thephantombot_
prefixfNameDest
- a new table name that does not yet exist, without thephantombot_
prefix
-
FileExists
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Indicates if the given table already exists- Overrides:
FileExists
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefix- Returns:
true
if the table exists
-
FileExists
Deprecated, for removal: This API element is subject to removal in a future version. -
GetFileList
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Returns a list of tables in the database.Only tables with the
phantombot_
prefix are returned. The prefix is removed- Overrides:
GetFileList
in classDataStore
- Returns:
- an array of table names
-
GetCategoryList
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Returns a list of all values in thesection
column within the table- Overrides:
GetCategoryList
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefix- Returns:
- an array of sections
-
GetKeyList
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Returns a list of all values in thevariable
column within the table and section- Overrides:
GetKeyList
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefixsection
- a section name.""
(empty string) for the default section;null
for all sections- Returns:
- an array of variables
-
GetKeyValueList
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Returns a list of allvariable/value
pairs within the table and section- Overrides:
GetKeyValueList
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefixsection
- a section name.""
(empty string) for the default section;null
for all sections- Returns:
- an array of
KeyValue
pairs denoting the variables and values
-
GetKeysByOrder
public String[] GetKeysByOrder(String fName, String section, String order, String limit, String offset) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Returns a list of values in thevariable
column within the table and section, sorted naturally- Overrides:
GetKeysByOrder
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefixsection
- a section name.""
(empty string) for the default section;null
for all sectionsorder
- sort order. Valid values:"ASC"
(Ascending) or"DESC"
(Descending)limit
- the maximum number of results to return from this queryoffset
- the offset to start reading from- Returns:
- a sorted list of variables
-
GetKeysByNumberOrder
public String[] GetKeysByNumberOrder(String fName, String section, String order, String limit, String offset) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Returns a list of values in thevariable
column within the table and section, sorted naturally as integers- Overrides:
GetKeysByNumberOrder
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefixsection
- a section name.""
(empty string) for the default section;null
for all sectionsorder
- sort order. Valid values:"ASC"
(Ascending) or"DESC"
(Descending)limit
- the maximum number of results to return from this queryoffset
- the offset to start reading from- Returns:
- a sorted list of variables
-
GetKeysByOrderValue
public String[] GetKeysByOrderValue(String fName, String section, String order, String limit, String offset) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Returns a list of values in thevariable
column within the table and section, sorted naturally by thevalue
column- Overrides:
GetKeysByOrderValue
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefixsection
- a section name.""
(empty string) for the default section;null
for all sectionsorder
- sort order. Valid values:"ASC"
(Ascending) or"DESC"
(Descending)limit
- the maximum number of results to return from this queryoffset
- the offset to start reading from- Returns:
- a sorted list of variables
-
GetKeysByNumberOrderValue
public String[] GetKeysByNumberOrderValue(String fName, String section, String order, String limit, String offset) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Returns a list of values in thevariable
column within the table and section, sorted naturally by thevalue
column as integers- Overrides:
GetKeysByNumberOrderValue
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefixsection
- a section name.""
(empty string) for the default section;null
for all sectionsorder
- sort order. Valid values:"ASC"
(Ascending) or"DESC"
(Descending)limit
- the maximum number of results to return from this queryoffset
- the offset to start reading from- Returns:
- a sorted list of variables
-
GetKeysByLikeValues
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Returns a list of values in thevariable
column within the table and section, where the value of thevalue
column contains the search phrase- Overrides:
GetKeysByLikeValues
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefixsection
- a section name.""
(empty string) for the default section;null
for all sectionssearch
- the partial value of thevalue
column to match against- Returns:
- a list of variables
-
GetKeysByLikeKeys
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Returns a list of values in thevariable
column within the table and section, where the value of thevariable
column contains the search phrase- Overrides:
GetKeysByLikeKeys
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefixsection
- a section name.""
(empty string) for the default section;null
for all sectionssearch
- the partial value of thevariable
column to match against- Returns:
- a list of variables
-
GetKeysByLikeKeysOrder
public String[] GetKeysByLikeKeysOrder(String fName, String section, String search, String order, String limit, String offset) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Returns a list of values in thevariable
column within the table and section, where the value of thevariable
column contains the search phrase, sorted naturally- Overrides:
GetKeysByLikeKeysOrder
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefixsection
- a section name.""
(empty string) for the default section;null
for all sectionssearch
- the partial value of thevariable
column to match againstorder
- sort order. Valid values:"ASC"
(Ascending) or"DESC"
(Descending)limit
- the maximum number of results to return from this queryoffset
- the offset to start reading from- Returns:
- a sorted list of variables
-
HasKey
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Indicates if the given table contains a row matching the given section and key -
GetKeyByValue
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Returns the value of thevariable
column for the given table, section, and value- Overrides:
GetKeyByValue
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefixsection
- a section name.""
(empty string) for the default section;null
for all sectionsvalue
- the value of thevalue
column- Returns:
- the variable;
null
if not found
-
GetString
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Returns the value of thevalue
column for the given table, section, and key as a stringA return value of
null
may denote that the table/row is not found, or that the actual stored value is SQLNULL
. UseDataStore.HasKey(String, String, String)
to verify if the row exists -
SetBatchString
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Performs a bulkDataStore.SetString(String, String, String, String)
operation, using available database features to do so more efficiently.The array index of the keys and value params are linked
- Overrides:
SetBatchString
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefixsection
- a section name.""
(empty string) for the default section;null
for all sectionskeys
- the values of thevariable
column to updatevalues
- the new values to set thevalue
column to
-
SetString
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Sets the value of thevalue
column for the given table, section, and key as a string -
IncreaseBatchString
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Increases the value of thevalue
column as an integer for all keys of the given table and section- Overrides:
IncreaseBatchString
in classDataStore
- Parameters:
fName
- a table name, without thephantombot_
prefixsection
- a section name.""
(empty string) for the default section;null
for all sectionskeys
- the values of thevariable
column to updatevalue
- the new value to increase thevalue
column by
-
query
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Executes an SQL queryThe query is executed using a
PreparedStatement
with calls toPreparedStatement.setString(int, String)
For example:
executeSql("SELECT * FROM foo WHERE bar = ?", ["baz"])
The value
"baz"
is escaped to prevent SQL injection, then inserted in place of the?
This yields the final query of
SELECT * FROM foo WHERE bar = "baz"
You can use
?
as many times as necessary, but must provide the same number of elements in the replacements array for the replacement to workReplacements are performed in order from left to right
Exceptions from failed SQL queries are NOT returned or thrown, but are logged in the core-error log
- Overrides:
query
in classDataStore
- Parameters:
sql
- The query to executereplacements
- Replacements forPreparedStatement.setString(int, String)
- Returns:
- An List of data as strings representing the result set, if the query was a DQL statement; an empty list otherwise. The outer list represents rows; the inner array represents columns; the values of the inner list represent the value of the row-column pair at that index as a string
-
CreateIndexes
public void CreateIndexes()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Ensures that all tables created withDataStore.AddFile(String)
have aUNIQUE
index across thesection
andvariable
columnsIf a constraint violation occurs while attempting to create the index, all rows violating the constraint except the first for each pair are deleted
- Overrides:
CreateIndexes
in classDataStore
-
CreateIndexes
Deprecated, for removal: This API element is subject to removal in a future version. -
DropIndexes
public void DropIndexes()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Drops allUNIQUE
indexes from tables created withDataStore.AddFile(String)
- Overrides:
DropIndexes
in classDataStore
-
DropIndexes
Deprecated, for removal: This API element is subject to removal in a future version. -
canBackup
public boolean canBackup()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Indicates if this database type supports generating backup files -
backupDB
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Backs up the database to the specified filename in thedbbackup
folder -
doMaintenance
public void doMaintenance()Deprecated, for removal: This API element is subject to removal in a future version. -
dispose
public void dispose()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:DataStore
Cleanup open connections
-
MySQLStore2
instead