agronholm / agronholm/sqlacodegen

Add support for a configuration file

Đang mở
#200 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Python
Star
2.4k
Fork
284
Merge trung bình
2 ngày 1 giờ
Pull request đã merge (30 ngày)
1

Mô tả

SQLACodegen is getting too many command line options to support comfortably. A configuration file would allow us to support a wide variety of options while keeping the required CLI incantations to a minimum. In particular, it would probably solve the problem presented in the oldest open issue, #25.

The biggest question is, what format to use? I think YAML and TOML are the only reasonable choices. YAML is in widespread use and offers a great end user experience. TOML, on the other hand, has a parser in standard library (3.11), but the standard is not widely used and even its author no longer recommends it. YAML has parsing pitfalls where special values can be interpreted as types other than the string the user probably expected. TOML

TOML pros:
- has a parser in standard library (3.11)
- we could use `pyproject.toml` to store the configuration

TOML cons:
- relatively new format, not widely used (tooling support isn't quite there yet)
- more verbose for complex structures than YAML
- even its author no longer recommends it

YAML pros:
- in widespread use
- offers a great end user experience

YAML cons:
- always requires an extra dependency
- has parsing pitfalls where special values can be interpreted as types other than the string the user probably expected

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.