named_dollar paramstyle

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
postgresql, python, sqlite
領域
backend, databases

調査の方向性

Look at SQLAlchemy's paramstyle handling in lib/sqlalchemy/engine/default.py and lib/sqlalchemy/sql/compiler.py. Understand how numeric_dollar is implemented and where paramstyle constants are defined. Test with SQLite's named dollar parameters to see the current behavior and what changes are needed to support named_dollar. Check if any tests exist for paramstyles in test/engine/test_default.py.

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

説明

dialects sql use case
Describe the use case

asyncpg uses the numeric_dollar paramstyle, but SQLite has an affordance for a named_dollar style as well.

There is precedent for this naming, in SQL Params.

It would be nice to be able to add this style to SQLAlchemy for completeness.

Databases / Backends / Drivers targeted

SQLite.

Also, maybe, one day, PostgreSQL? While client parameters are still exclusively numbered, named SQL function parameters were added to PostgreSQL 9.2, which suggests maybe such a thing could be added to the driver interface eventually?

Example Use

N/A

Additional context

I'm trying to define a type-safe "paramstyle" parameter in DBXS while supporting this paramstyle for completeness, and SQLAlchemy support means I can't actually include it in the published type without triggering potential type errors.

I don't really need it but it would be nice to get it added in advance of any driver deciding this is a good way to do things, so this should be considered low-priority if at all.

主要言語
Python
スター
12.3k
フォーク
1.8k
平均マージ
2日 10時間
マージ済み PR(30日)
9

環境構築

はじめの一歩

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

sqlalchemy/sqlalchemy のほかの issue

sqlalchemy/sqlalchemy の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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