Skip to content

Commit

Permalink
release 2.569.24076
Browse files Browse the repository at this point in the history
  • Loading branch information
klahnakoski committed Mar 16, 2024
2 parents 618aad7 + 4ac4211 commit 7299669
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 27 deletions.
9 changes: 5 additions & 4 deletions mo_sqlite/transacfion.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from dataclasses import is_dataclass, fields
from typing import Optional

from mo_dots import unwraplist, Data, is_missing
from mo_future import allocate_lock as _allocate_lock
Expand Down Expand Up @@ -120,16 +121,16 @@ def table_to_list(result, *, as_dataclass):
field_names = fields(as_dataclass)
fields_to_index = [None] * len(field_names)
for fi, f in enumerate(field_names):
for hi, h in enumerate(result.header):
for index, h in enumerate(result.header):
if untype_field(h)[0] == f.name:
fields_to_index[fi] = hi
fields_to_index[fi] = index

output = []
for row in result.data:
obj = object.__new__(as_dataclass)
obj.__dict__ = {
f.name: None if hi is None else value_to_type(row[hi], f.type)
for f, hi in zip(field_names, fields_to_index)
f.name: None if header_index is None else row[header_index]
for f, header_index in zip(field_names, fields_to_index)
}
output.append(obj)
return output
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>=7.523.24033"]},
include_package_data=True,
install_requires=["jx-python==4.556.24070","mo-dots==9.549.24062","mo-files==6.556.24070","mo-future==7.546.24057","mo-imports==7.546.24057","mo-json==6.556.24070","mo-kwargs==7.551.24062","mo-logs==8.556.24070","mo-math==7.552.24062","mo-sql==4.556.24070","mo-sql==4.556.24070","mo-threads==6.556.24070","mo-times==5.556.24070"],
install_requires=["jx-python==4.568.24076","mo-dots==9.565.24076","mo-files==6.566.24076","mo-future==7.546.24057","mo-imports==7.546.24057","mo-json==6.566.24076","mo-kwargs==7.565.24076","mo-logs==8.566.24076","mo-math==7.565.24076","mo-sql==4.569.24076","mo-sql==4.569.24076","mo-threads==6.566.24076","mo-times==5.566.24076"],
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.558.24071'
version='2.569.24076'
)
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>=7.523.24033"]},
"include_package_data": true,
"install_requires": [
"jx-python==4.556.24070", "mo-dots==9.549.24062", "mo-files==6.556.24070",
"mo-future==7.546.24057", "mo-imports==7.546.24057", "mo-json==6.556.24070",
"mo-kwargs==7.551.24062", "mo-logs==8.556.24070", "mo-math==7.552.24062",
"mo-sql==4.556.24070", "mo-sql==4.556.24070", "mo-threads==6.556.24070",
"mo-times==5.556.24070"
"jx-python==4.568.24076", "mo-dots==9.565.24076", "mo-files==6.566.24076",
"mo-future==7.546.24057", "mo-imports==7.546.24057", "mo-json==6.566.24076",
"mo-kwargs==7.565.24076", "mo-logs==8.566.24076", "mo-math==7.565.24076",
"mo-sql==4.569.24076", "mo-sql==4.569.24076", "mo-threads==6.566.24076",
"mo-times==5.566.24076"
],
"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.558.24071"
"version": "2.569.24076"
}
28 changes: 14 additions & 14 deletions tests/requirements.lock
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Tests pass with these versions 2024-03-11
# Tests pass with these versions 2024-03-16
# pip install --no-deps -r tests/requirements.lock
certifi==2024.2.2
charset-normalizer==3.3.2
hjson==3.1.0
idna==3.6
jx-python==4.556.24070
mo-collections==5.556.24070
mo-dots==9.549.24062
mo-files==6.556.24070
jx-python==4.568.24076
mo-collections==5.566.24076
mo-dots==9.565.24076
mo-files==6.566.24076
mo-future==7.546.24057
mo-imports==7.546.24057
mo-json==6.556.24070
mo-json-config==4.556.24070
mo-kwargs==7.551.24062
mo-logs==8.556.24070
mo-math==7.552.24062
mo-sql==4.556.24070
mo-testing==7.523.24033
mo-threads==6.556.24070
mo-times==5.556.24070
mo-json==6.566.24076
mo-json-config==4.566.24076
mo-kwargs==7.565.24076
mo-logs==8.566.24076
mo-math==7.565.24076
mo-sql==4.569.24076
mo-testing==7.562.24075
mo-threads==6.566.24076
mo-times==5.566.24076
requests==2.31.0
urllib3==2.2.0
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mo-testing>=7.523.24033
mo-testing>=7.562.24075

0 comments on commit 7299669

Please sign in to comment.