sqlc
PyPika
Our great sponsors
sqlc | PyPika | |
---|---|---|
169 | 4 | |
10,837 | 2,367 | |
5.6% | 2.1% | |
9.7 | 5.5 | |
5 days ago | 7 days ago | |
Go | Python | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
sqlc
-
Give Up Sooner
"Is there a way to get sqlc to use pointers for nullable columns instead of the sql.Null types?"
-
Show HN: Sqlbind a Python library to compose raw SQL
I came across this yesterday for golang: https://sqlc.dev which is somewhat like what you want, maybe.
Not sure it allows you to parameterize table names but the basic idea is codegen from sql queries so you are working with go code (autocompletion etc).
- API completa em Golang - Parte 7
-
ORMs are nice but they are the wrong abstraction
Agreed, but tools like https://sqlc.dev, which I mention in the article, are a good trade-off that allows you to have verified, testable, SQL in your code.
- API completa em Golang - Parte 6
-
Go ORMs Compared
sqlc is not strictly a conventional ORM. It offers a unique approach by generating Go code from SQL queries. This allows developers to write SQL, which sqlc then converts into type-safe Go code, reducing the boilerplate significantly. It ensures that your queries are syntactically correct and type-safe. sqlc is ideal for those who prefer writing SQL and are looking for an efficient way to integrate it into a Go application.
-
Type-safe Data Access in Go using Prisma and sqlc
I was browsing awesome-go for ideas on how to setup my data access layer when I stumbled on sqlc. It seemed like a great option. Code generation is a strategy often used in the Go ecosystem and making my queries safe at compile time was an idea I really liked. Knex was great, but it required of me that I test thoroughly my queries at runtime and that I sanitize my query results to ensure type safety within my application.
-
Level UP your RDBMS Productivity in GO
Now, we are going to generate the code. For this purpose, we are going to use sqlc.
-
What 3rd-party libraries do you use often/all the time?
https://github.com/sqlc-dev/sqlc — for use with //go:generate
- API completa em Golang - Parte 1
PyPika
-
any recommendations for a good query builder library with good support?
I recently started using drizzle orm and I am now looking for something similar in python, my goal is to be as close to sql syntax as possible without just passing dml commands as strings, type safety would be cool as well, I saw this one pypika but it ha a lot of open issues and no commits for a year, is there anything similar but more stable?
-
Ask HN: Is SQLAlchemy the industry standard Python ORM in 2023?
Yes it is. I haven't seen many Python projects using Prisma and
Note that there are several types of technologies that can help connect an application to an SQL database:
- SQL builders: the best known project seems to be Pypika by Kayak (https://github.com/kayak/pypika) but it seems to be dead of sleeping.
-
Write an SQL query builder in 150 lines of Python
https://github.com/kayak/pypika
Have used in multiple projects and have found it's the right balance between ORMs and writing raw SQL. It's also easily extensible and takes care of the many edge cases and nuances of rolling your own SQL generator.
-
Migrating to SQLAlchemy 2.0
There is a middle-ground between writing SQL statement strings in your code, and a full-blown ORM: query builders. At least in my experience with small to medium projects, these have far fewer footguns while keeping the code composable and readable. Here's one for Python: https://github.com/kayak/pypika
What are some alternatives?
sqlx - general purpose extensions to golang's database/sql
TinyDB - TinyDB is a lightweight document oriented database optimized for your happiness :)
GORM - The fantastic ORM library for Golang, aims to be developer friendly
asyncpg - A fast PostgreSQL Database Client Library for Python/asyncio.
SQLBoiler - Generate a Go ORM tailored to your database schema.
tksheet - Python tkinter table widget for displaying tabular data
ent - An entity framework for Go
PipelineDB - High-performance time-series aggregation for PostgreSQL
jet - Type safe SQL builder with code generation and automatic query result data mapping
pickleDB - pickleDB is an open source key-value store using Python's json module.
pgx - PostgreSQL driver and toolkit for Go
django-compositepk-model - Extended Django Model class with composite-primary-key support