magicstack / py-pgproto Goto Github PK
View Code? Open in Web Editor NEWLow-level IO utilities for PosgtreSQL drivers.
Home Page: https://github.com/MagicStack/asyncpg
License: Apache License 2.0
Low-level IO utilities for PosgtreSQL drivers.
Home Page: https://github.com/MagicStack/asyncpg
License: Apache License 2.0
Getting a lot of these errors when trying to build https://github.com/MagicStack/asyncpg on Python 3.12:
asyncpg/pgproto/pgproto.c:40800:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~ ^
asyncpg/pgproto/pgproto.c:40855:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~ ^
asyncpg/pgproto/pgproto.c:41034:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~ ^
I believe this can be solved by converting ((PyLongObject*)x)->ob_digit
to ((PyLongObject*)x)->long_value->ob_digit
Should the argument x
here have type int32_t
?
pack_int32(char *buf, int64_t x)
I understand that the current version will produce exactly the same result.
While working on ChunkedBuffer:
https://github.com/tzickel/chunkedbuffer
I think it's for calling python methods which are already bound to a Python object, it's faster to do instead of (check the annotated output):
self._bufs_popleft(...)
this:
with cython.optimize.unpack_method_calls(False):
self._bufs_popleft(...)
^^- but it's better to leave it though for calling other stuff, like when calling an .find directly.
Also instead of:
self._bufs = collections.deque()
it's less code
from collections import deque
self._bufs = deque()
The codecs.Codec.decode()
and encode()
APIs return a tuple, while the current code is assuming its first item:
Lines 17 to 18 in e7f1a02
Lines 42 to 43 in e7f1a02
This leads to issues in asyncpg when client_encoding
is not UTF-8 - all text results are tuples, while text arguments fail to be encoded with errors.
Trying copy_records_to_table
i have this error:
no binary format encoder for type macaddr (OID 829)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.