Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(ORM): add new APIs #10

Merged
merged 22 commits into from
Jul 21, 2024
Merged

feature(ORM): add new APIs #10

merged 22 commits into from
Jul 21, 2024

Conversation

pga2rn
Copy link
Owner

@pga2rn pga2rn commented Jul 21, 2024

Introduction

This PR adds new APIs to ORM:

Applies to ORMBase, ORMThreadPoolBase and AsyncORMThreadPoolBase:

  1. add orm_execute: similar to sqlite3.Connection.execute, execute one sqlite statement and return all result in a list.
  2. add orm_select_entry: select exactly one entry from the database.

Applies to ORMThreadPoolBase and AsyncORMThreadPoolBase:

  1. add orm_pool_shutdown: close the threadpool and optionally close the connections used in the pool.

Other changes:

  1. add tests covering the new APIs.
  2. orm: minor fix to typing.
  3. orm: assign API docstrings from ORMBase to each thread pool variants.
  4. typing: now copy_callable_typehint will also copy the __doc__ from source to target.
  5. minor update and refinement to the test files.

@pga2rn pga2rn added the feature label Jul 21, 2024
@pga2rn pga2rn changed the title feature: add new APIs orm_select_entry and orm_execute feature(ORM): add new APIs Jul 21, 2024
Copy link

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/simple_sqlite3_orm
   __init__.py70100% 
   _orm.py2322688%44, 46–47, 50–51, 149, 403, 448, 504, 506–507, 516–517, 519, 553, 574, 615, 646, 648–649, 658–659, 661, 696, 725, 778
   _sqlite_spec.py360100% 
   _table_spec.py1712187%45, 60, 69, 80, 84–85, 97, 109, 126, 187, 192–194, 270, 272, 274–275, 333–334, 443–444
   _types.py19194%27
   _typing.py90100% 
   _utils.py51590%52, 65, 68, 78, 91
   utils.py971782%112, 119–120, 155–158, 204, 217, 237–241, 267, 271, 312
TOTAL6227088% 

Tests Skipped Failures Errors Time
62 0 💤 0 ❌ 0 🔥 2m 6s ⏱️

Copy link

sonarcloud bot commented Jul 21, 2024

@pga2rn pga2rn marked this pull request as ready for review July 21, 2024 08:19
@pga2rn pga2rn merged commit 5a7f4b5 into main Jul 21, 2024
10 checks passed
@pga2rn pga2rn deleted the feature/new_apis branch July 21, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant