modulepackage
1.0.51
Repository: https://github.com/mutablelogic/go-sqlite.git
Documentation: pkg.go.dev
# README
go-sqlite
This module provides an interface for sqlite, including:
- Opening in-memory databases and persistent file-based databases;
- Transactions (committing changes and rolling back on errors);
- Adding custom functions, authentication and authorization;
- Reflection on databases (schemas, tables, columns, indexes, etc);
- Executing arbitrary statements or building statements programmatically;
- A pool of connections to run sqlite in a highliy concurrent environment such as a webservice;
- A backend REST API for sqlite;
- A generalized importer to import data from other data sources in different formats;
- A generalized file indexer to index files in a directory tree and provide a REST API to search them;
- A frontend web application to explore and interact with databases.
Presently the module is in development and the API is subject to change.
If you want to... | Folder | Documentation |
---|---|---|
Use the lower-level sqlite3 bindings similar to the C API | sys/sqlite3 | README.md |
Use high-concurrency high-level interface including statement caching and connection pool | pkg/sqlite3 | README.md |
Implement or use a REST API to sqlite3 | plugin/sqlite3 | README.md |
Develop or use a front-end web service to the REST API backend | npm/sqlite3 | README.md |
Use an "object" interface to persist structured data | pkg/sqobj | README.md |
Use a statement builder to programmatically write SQL statements | pkg/lang | README.md |
Implement a generalized data importer from CSV, JSON, Excel, etc | pkg/importer | README.md |
Implement a search indexer | pkg/indexer | README.md |
Tokenize SQL statements for syntax colouring (for example) | pkg/tokenizer | README.md |
See example command-line tools | cmd | README.md |
Requirements
- go1.17 or later;
- Tested on Debian Linux (32- and 64- bit) on ARM and macOS on x64 architectures.
Building
There are some examples in the cmd
folder of the main repository on how to use
the package. The various make targets are:
make all
will perform tests, build all examples, the backend API and the frontend web application;make test
will perform tests;make cmd
will build example command-line tools into thebuild
folder;make server plugins
will install the backend server and required plugins in thebuild
folder;make npm
will compile the frontend web application in a 'dist' folder for each npm module located in thenpm
folder;make clean
will remove all build artifacts.
Contributing & Distribution
This module is currently in development and subject to change.
Please do file feature requests and bugs here. The license is Apache 2 so feel free to redistribute. Redistributions in either source code or binary form must reproduce the copyright notice, and please link back to this repository for more information:
Copyright (c) 2021, David Thorpe, All rights reserved.
# Constants
Alter operation.
Analyze operation.
Begin txn operation.
Commit txn operation.
Create operation.
Delete operation.
Drop operation.
Execute function operation.
Index Object.
Insert operation.
No description provided by the author
No description provided by the author
No description provided by the author
Pragma operation.
Read column operation.
Rollback txn operation.
Table Object.
Temporary Object.
Transaction.
Trigger Object.
Update column operation.
View Object.
Virtual Table Object.
No description provided by the author
Cache prepared statements.
Enable foreign key support.
Overwrite objects.
Default transaction flag.
Exclusive transaction.
Immediate transaction.
Drop foreign key constraints on this transaction.
TagName defines the tag name used for struct tags.
# Structs
No description provided by the author
# Interfaces
SQAlter defines an alter table statement.
SQAuth is an interface for authenticating an action.
SQClass is a class definition, which can be a table or view.
SQColumn represents a column definition.
SQConnection is an sqlite connection to one or more databases.
SQDrop defines a drop for tables, views, indexes, and triggers.
SQExpr defines any expression.
SQForeignKey represents a foreign key constraint.
No description provided by the author
No description provided by the author
SQIndexView defines a create index or view statement.
SQInsert defines an insert or replace statement.
SQIterator is an iterator for a Read operation.
SQJoin defines one or more joins.
SQPool is an sqlite connection pool.
SQResults increments over returned rows from a query.
SQSelect defines a select statement.
SQSource defines a table or column name.
SQStatement is any statement which can be prepared or executed.
SQTable defines a table of columns and indexes.
SQTransaction is an sqlite transaction.
SQTrigger defines a create trigger statement.
SQUpdate defines an update statement.
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author