Skip to content

Commit

Permalink
release 2.625.24125
Browse files Browse the repository at this point in the history
  • Loading branch information
klahnakoski committed May 4, 2024
2 parents 660a552 + 5edd1ba commit 568caa6
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 24 deletions.
2 changes: 1 addition & 1 deletion mo_sqlite/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def close(self):
logger.error("Use stop()")

def __enter__(self):
pass
return self

def __exit__(self, exc_type, exc_val, exc_tb):
self.stop()
Expand Down
4 changes: 2 additions & 2 deletions packaging/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
description='Multithreading for Sqlite, plus expression composition',
extras_require={"tests":["mo-testing>=8.591.24112","beautifulsoup4>=4.12.3"]},
include_package_data=True,
install_requires=["jx-python==4.607.24116","mo-dots==9.606.24115","mo-files==6.606.24115","mo-future==7.584.24095","mo-imports==7.584.24095","mo-json==6.606.24115","mo-kwargs==7.606.24115","mo-logs==8.606.24115","mo-math==7.606.24115","mo-sql==4.606.24115","mo-sql==4.606.24115","mo-threads==6.606.24115","mo-times==5.606.24115"],
install_requires=["jx-python==4.625.24125","mo-dots==10.623.24125","mo-files==6.624.24125","mo-future==7.584.24095","mo-imports==7.584.24095","mo-json==6.624.24125","mo-kwargs==7.623.24125","mo-logs==8.623.24125","mo-math==7.623.24125","mo-sql==4.624.24125","mo-sql==4.624.24125","mo-threads==6.624.24125","mo-times==5.623.24125"],
license='MPL 2.0',
long_description='# More SQLite!\n\nMultithreading for Sqlite, plus expression composition\n\n\n[![PyPI Latest Release](https://img.shields.io/pypi/v/mo-sqlite.svg)](https://pypi.org/project/mo-sqlite/)\n[![Build Status](https://github.com/klahnakoski/mo-sqlite/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/klahnakoski/mo-sqlite/actions/workflows/build.yml)\n[![Coverage Status](https://coveralls.io/repos/github/klahnakoski/mo-sqlite/badge.svg?branch=dev)](https://coveralls.io/github/klahnakoski/mo-sqlite?branch=dev)\n[![Downloads](https://pepy.tech/badge/mo-sqlite/month)](https://pepy.tech/project/mo-sqlite)\n\n\n## Multi-threaded Sqlite\n\nThis module wraps the `sqlite3.connection` with thread-safe traffic manager. Here is typical usage: \n\n from mo_sqlite import Sqlite\n db = Sqlite("mydb.sqlite")\n with db.transaction() as t:\n t.command("insert into mytable values (1, 2, 3)")\n\nWhile you may have each thread own a `sqlite3.connection` to the same file, you will still get exceptions when another thread has the file locked.\n\n## Pull JSON out of database\n\nThis module includes a minimum experimental structure that can describe pulling deeply nested JSON documents out of a normalized database. The tactic is to shape a single query who\'s resultset can be easily converted to the desired JSON by Python. Read more on [pulling json from a database](docs/JSON%20in%20Database.md)\n\nThere are multiple normal forms, including domain key normal form, and columnar form; these have a multitude one-to-one relations, all represent the same logical schema, but differ in their access patterns to optimize for particular use cases. This module intends to hide the particular database schema from the caller; exposing just the logical schema. \n\n\n\nThis experiment compliments the [mo-columns](https://github.com/klahnakoski/mo-columns) experiment, which is about pushing JSON into a database. \n ',
long_description_content_type='text/markdown',
name='mo-sqlite',
packages=["mo_sqlite","mo_sqlite.expressions"],
url='https://github.com/klahnakoski/mo-sqlite',
version='2.607.24116'
version='2.625.24125'
)
12 changes: 6 additions & 6 deletions packaging/setuptools.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"extras_require": {"tests": ["mo-testing>=8.591.24112", "beautifulsoup4>=4.12.3"]},
"include_package_data": true,
"install_requires": [
"jx-python==4.607.24116", "mo-dots==9.606.24115", "mo-files==6.606.24115",
"mo-future==7.584.24095", "mo-imports==7.584.24095", "mo-json==6.606.24115",
"mo-kwargs==7.606.24115", "mo-logs==8.606.24115", "mo-math==7.606.24115",
"mo-sql==4.606.24115", "mo-sql==4.606.24115", "mo-threads==6.606.24115",
"mo-times==5.606.24115"
"jx-python==4.625.24125", "mo-dots==10.623.24125", "mo-files==6.624.24125",
"mo-future==7.584.24095", "mo-imports==7.584.24095", "mo-json==6.624.24125",
"mo-kwargs==7.623.24125", "mo-logs==8.623.24125", "mo-math==7.623.24125",
"mo-sql==4.624.24125", "mo-sql==4.624.24125", "mo-threads==6.624.24125",
"mo-times==5.623.24125"
],
"license": "MPL 2.0",
"long_description": {
Expand Down Expand Up @@ -66,5 +66,5 @@
"name": "mo-sqlite",
"packages": ["mo_sqlite", "mo_sqlite.expressions"],
"url": "https://github.com/klahnakoski/mo-sqlite",
"version": "2.607.24116"
"version": "2.625.24125"
}
29 changes: 15 additions & 14 deletions tests/requirements.lock
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# Tests pass with these versions 2024-04-25
# Tests pass with python 3.8 on 2024-05-04 and with these versions
# pip install --no-deps -r tests/requirements.lock
beautifulsoup4==4.12.3
certifi==2024.2.2
charset-normalizer==3.3.2
hjson==3.1.0
idna==3.6
jx-python==4.607.24116
mo-collections==5.606.24115
mo-dots==9.606.24115
mo-files==6.606.24115
jx-python==4.625.24125
mo-collections==5.623.24125
mo-dots==10.623.24125
mo-files==6.624.24125
mo-future==7.584.24095
mo-imports==7.584.24095
mo-json==6.606.24115
mo-json-config==4.606.24115
mo-kwargs==7.606.24115
mo-logs==8.606.24115
mo-math==7.606.24115
mo-sql==4.606.24115
mo-testing==8.591.24112
mo-threads==6.606.24115
mo-times==5.606.24115
mo-json==6.624.24125
mo-json-config==4.624.24125
mo-kwargs==7.623.24125
mo-logs==8.623.24125
mo-math==7.623.24125
mo-sql==4.624.24125
mo-testing==8.623.24125
mo-threads==6.624.24125
mo-times==5.623.24125
pytz==2024.1
requests==2.31.0
soupsieve==2.5
urllib3==2.2.0
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mo-testing>=8.591.24112
mo-testing>=8.623.24125
beautifulsoup4>=4.12.3
13 changes: 13 additions & 0 deletions tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,16 @@ def test_change_only(self):
result = t.query("SELECT * FROM t")

self.assertEqual(result.data, [(1, 2)])

def test_context_manager(self):
with Sqlite() as db:
with db.transaction() as t:
t.execute("CREATE TABLE t (a INTEGER, b INTEGER)")

with db.transaction() as t:
t.execute("INSERT INTO t (a, b) VALUES (1, 2)")
result = t.query("SELECT * FROM t")

self.assertEqual(result.data, [(1, 2)])

self.assertTrue(db.closed)

0 comments on commit 568caa6

Please sign in to comment.