Documentation
¶
Overview ¶
Copyright © 2021 Andrew Mobbs <andrew.mobbs@gmail.com>
Permission is hereby granted, free of charge, any person obtaining a copy of this software and associated documentation files (the "Software"), deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- func ExecBulkSql(db *sql.DB, sql string, values []string) error
- func ExecSqlStatement(db *sql.DB, sql string) error
- func InitAppDB(dbPath string, appName string, schemaVersion uint8, schema []string) (*sql.DB, error)
- func Open(dbPath string, appName string, schemaVersion uint8) (*sql.DB, error)
- type AppIdError
- type SchemaError
- type SchemaVersionError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecBulkSql ¶
ExecBulkSql prepares one SQL statement and executes it once for each set of values provides.
func ExecSqlStatement ¶
ExecSqlStatement prepares and executes one simple SQL statement and discards the result.
func InitAppDB ¶
func InitAppDB(dbPath string, appName string, schemaVersion uint8, schema []string) (*sql.DB, error)
InitAppDB initialises a sqlite3 database at the given path, opening if it exists, creating file & path if not. dbPath -- the filesystem location of the database file appName -- name of application (arbitrary string, used to validate database) schemaVersion -- version of schema in use (8-bit integer, used to validate database) schema -- SQL statements to initialise database schema.
Types ¶
type AppIdError ¶
func (*AppIdError) Error ¶
func (e *AppIdError) Error() string
type SchemaError ¶
func (*SchemaError) Error ¶
func (e *SchemaError) Error() string
type SchemaVersionError ¶
func (*SchemaVersionError) Error ¶
func (e *SchemaVersionError) Error() string