Skip to main content

SQLite


Installation

pip3 install Surfy.SQLite

Usage

from sqlite import DB

db = DB('PATH_TO_FILE')

Methods

.query(query)

result = db.query('''CREATE TABLE IF NOT EXISTS test_table
	(id INTEGER PRIMARY KEY AUTOINCREMENT,
	createTime TEXT,
	data TEXT COLLATE NOCASE,
	extradata TEXT,
	counter INTEGER,
	realNumber REAL,
	object TEXT,
	array TEXT);''')

.table(table_name)

testTable = db.table('test_table')

table.insertOne(row)

Inserts a single row into a table

insertedID = testTable.insertOne({
	'createTime': 'CURRENT_TIME',
	'data': 'Some Data 1',
	'extradata': 'Some Extra Data',
	'counter': 2,
	'realNumber': 2.52,
	'object': {
		'field': 'value'
	},
	'array': [1,2,3]
})

table.insert(rows)

Inserts data into a table

insertedIDs = testTable.insert(
	[
		{
			'createTime': 'CURRENT_TIME', 'data': 'Some Data 1'
		},
		{
			'createTime': 'CURRENT_TIME', 'data': 'Some Data 2'
		},
		{
			'createTime': 'CURRENT_TIME', 'data': 'Some Data 3'
		}
	]
)

table.findOne(match, options)

Finds one row in a table

match = {
	'data': 'Some Data 2'
}

options = {
	'fields': ['id', 'currentTime', 'data']
}

result = testTable.findOne(match, options)

'''

result {
	'id': 3,
	'currentTime': datetime.datetime(2023, 2, 10, 21, 2, 20),
	'data': 'Some Data 2'
}

'''

table.find(match, options)

Finds matches in a table

match = {
	'data': {
		'$like': 'Some Data %'
	}
}

options = {
	'fields': ['id', 'currentTime', 'data'],
	'skip': 2,
	'limit': 1
}

result = testTable.find(match, options)

'''

result [
	{
		'id': 3,
		'currentTime': datetime.datetime(2023, 2, 10, 21, 2, 20),
		'data': 'Some Data 2'
	}
]

'''


MIT License

Alexander Yermolenko • surfy.one

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to 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.

Metadata

Release files for Surfy.SQLite 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Surfy.SQLite 1.0.0
File Size Uploaded Provenance Actions
Surfy.SQLite-1.0.0.tar.gz 4.5 kB Without provenance Details for Surfy.SQLite-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for Surfy.SQLite 1.0.0
File Interpreter ABI Platform Actions
Surfy.SQLite-1.0.0-py3-none-any.whl Python 3 none any Details for Surfy.SQLite-1.0.0-py3-none-any.whl

Total release size: 9.0 kB

Release files / Surfy.SQLite-1.0.0.tar.gz

Download URL Surfy.SQLite-1.0.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d05a6dd7cf98c039763d8c556c2aa233d16c715c9595473def8914400dd9d3d0
BLAKE2b-256 checksum
How to use checksums
074e0da7c7c10f5a6717abf50da1be62175e0d152e1a6abf774757f99233a630
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.6

Release files / Surfy.SQLite-1.0.0-py3-none-any.whl

Download URL Surfy.SQLite-1.0.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e93c3955a4c4ba212e7e737aff8447d5b2210fbbcbae438d25e008f8509a7342
BLAKE2b-256 checksum
How to use checksums
0fa0fd3cc4b2704662d1cf20142b0c5e232a65c8cacf246ff03f062a4e4faee8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.6

Security for Surfy.SQLite 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page