MagicStack / MagicStack/asyncpg

Late/optional decoding?

オープン
#1,112 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
8.1k
フォーク
468
PR マージ指標
30日以内にマージされた PR はありません

説明

I have a few interrelated questions. Some might even be blasphemous for lack of in-depth knowledge of the wire protocol on my part.

1. Is there a way to delay decoding results until actually looking at data and interpreting it would become necessary?
2. Similarly, would it be possible to take undecoded "records" (not in the strict field-to-value map sense of asyncpg records) and pass them as-is to an upsert without having to re-encode them, so long as the bound arguments correspond to those returned by the previous query?
3. Would that potentially avoid the need to issue type introspection queries?
4. If not as of today, would this become easier once @vmarkovtsev's `asyncpg-rkt` fork gets merged back upstream?
5. Otherwise, at the very least, would it be possible to decode timestamps to something closer to their internal postgres representation - for example mapping them to the Python's `decimal` type? I personally find that python's `datetime` is terrible and Postgres timestamps can fall outside of the range that can be represented via `datetime`. Should such a decimal codec come with `asyncpg`, or should everyone write their own if and only if they think they need it?

Thank you & happy new year!

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

ファイル、テスト、エントリポイントは指定されていません。まず asyncpg のデコード、型イントロスペクション、record の転送、timestamp codec の各パスを追跡し、次にこれらの要求を独立してスコープ設定できるかどうかを判断してください。完了とするには、メンテナーが承認した設計、または明確に範囲を限定した実装計画が必要です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
postgresql, python
領域
backend, databases
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。