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

Implement docstring, missing methods, basic streaming #56

Merged
merged 39 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
62380ed
Auto generating schema, docstring
Razikus Sep 5, 2022
38f0f04
All messages into dataclasses
Razikus Sep 6, 2022
0bdce95
Adding missing pytz
Razikus Sep 6, 2022
9df2c4b
Covering api
Razikus Sep 7, 2022
6bf405d
stream set
Razikus Sep 7, 2022
044450f
StreamSet from buffer
Razikus Sep 8, 2022
6fd0748
Streams as file-like objects
Razikus Sep 9, 2022
6e95a93
Streams as file-like objects
Razikus Sep 9, 2022
f8cf508
Decrease test set size
Razikus Sep 9, 2022
ec7bf30
Decrease test set size
Razikus Sep 9, 2022
ddeb59d
Incrased reader size for one test
Razikus Sep 9, 2022
30e0a9d
Changed definition, test for smaller set
Razikus Sep 9, 2022
47dfdd1
structure change
Razikus Sep 9, 2022
5d5d63f
Update grpc
Razikus Sep 9, 2022
44e3501
Added tests, typing, docstring, replication, exporttx
Razikus Sep 11, 2022
333442b
Updated docstring
Razikus Sep 11, 2022
6bf7954
Autopep
Razikus Sep 11, 2022
b42d673
Added skips for older immudb versions
Razikus Sep 11, 2022
bc979ec
Autopep8 fixes
Razikus Sep 12, 2022
8fa332a
Autopep fixes
Razikus Sep 12, 2022
81f887e
removed unused imports
Razikus Sep 12, 2022
5f80d7e
docs(ImmudbClient): revise and reformat docstring
NickAnderegg Oct 13, 2022
f100954
docs(openSession, openManagedSession): revise docstring
NickAnderegg Oct 13, 2022
2679cff
docs(ImmudbClient.*): revise and clarify docstrings for various methods
NickAnderegg Oct 13, 2022
4039e5e
docs(ImmudbClient.*): revise docstrings
NickAnderegg Oct 13, 2022
50e437a
Add license
Razikus Oct 20, 2022
07780c9
Adding comments
Razikus Oct 20, 2022
8e7afe2
VerifiableSQL
Razikus Oct 20, 2022
8d5b2ad
Merge branch 'feature/fullapisupport' of github.com:codenotary/immudb…
Razikus Oct 20, 2022
ea8a460
VerifiedSQL, 1.4.0 bump
Razikus Oct 20, 2022
8fc5e96
removed unused dependency
Razikus Oct 20, 2022
40ac334
StreamHistory, StreamZScan
Razikus Oct 20, 2022
58ae1b7
stream verifiable get, stream zscan
Razikus Oct 20, 2022
cba5785
Verified Set
Razikus Oct 20, 2022
433a5fa
removed bad assert
Razikus Oct 20, 2022
ff66cce
Stream Exec All
Razikus Oct 20, 2022
d268d96
Auto pep 8
Razikus Oct 20, 2022
3ae0055
Adjustin pep8
Razikus Oct 21, 2022
0380aac
Documentation update
Razikus Oct 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,076 changes: 933 additions & 143 deletions immudb/client.py

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions immudb/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
PERMISSION_R = 1
PERMISSION_RW = 2

PERMISSION_GRANT = 0
PERMISSION_REVOKE = 1

SET_KEY_PREFIX = b'\x00'
SORTED_KEY_PREFIX = b'\x01'

Expand Down
32 changes: 32 additions & 0 deletions immudb/dataconverter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

Razikus marked this conversation as resolved.
Show resolved Hide resolved

import immudb.datatypesv2 as datatypesv2


def convertResponse(fromResponse, toHumanDataClass=True):
"""Converts response from GRPC to python dataclass

Args:
fromResponse (GRPCResponse): GRPC response from immudb
toHumanDataClass (bool, optional): decides if final product should be converted to 'human' dataclass (final product have to override _getHumanDataClass method). Defaults to True.

Returns:
DataClass: corresponding dataclass type
"""
if fromResponse.__class__.__name__ == "RepeatedCompositeContainer":
all = []
for item in fromResponse:
all.append(convertResponse(item))
return all
schemaFrom = datatypesv2.__dict__.get(
fromResponse.__class__.__name__, None)
if schemaFrom:
construct = dict()
for field in fromResponse.ListFields():
construct[field[0].name] = convertResponse(field[1], False)
if toHumanDataClass:
return schemaFrom(**construct)._getHumanDataClass()
else:
return schemaFrom(**construct)
else:
return fromResponse
Loading