Show HN: Sqlbind a Python library to compose raw SQL

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • sqlbind

    Lightweight text-based SQL parameter binds

  • django-query-profiler

    Django query profiler - one profiler to rule them all. Shows queries, detects N+1 and gives recommendations on how to resolve them

  • But that's still not backend-specific SQL?

    There should be an interface method for this. Why does psycopg call it mogrify?

    https://django-debug-toolbar.readthedocs.io/en/latest/panels... :

    > debug_toolbar.panels.sql.SQLPanel: SQL queries including time to execute and links to EXPLAIN each query

    But debug toolbars mostly don't work with APIs.

    https://github.com/django-query-profiler/django-query-profil... :

    > Django query profiler - one profiler to rule them all. Shows queries, detects N+1 and gives recommendations on how to resolve them

    https://github.com/jazzband/django-silk :

    > Silk is a live profiling and inspection tool for the Django framework. Silk intercepts and stores HTTP requests and database queries before presenting them in a user interface for further inspection

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • But that's still not backend-specific SQL?

    There should be an interface method for this. Why does psycopg call it mogrify?

    https://django-debug-toolbar.readthedocs.io/en/latest/panels... :

    > debug_toolbar.panels.sql.SQLPanel: SQL queries including time to execute and links to EXPLAIN each query

    But debug toolbars mostly don't work with APIs.

    https://github.com/django-query-profiler/django-query-profil... :

    > Django query profiler - one profiler to rule them all. Shows queries, detects N+1 and gives recommendations on how to resolve them

    https://github.com/jazzband/django-silk :

    > Silk is a live profiling and inspection tool for the Django framework. Silk intercepts and stores HTTP requests and database queries before presenting them in a user interface for further inspection

  • django-silk

    Silky smooth profiling for Django

  • But that's still not backend-specific SQL?

    There should be an interface method for this. Why does psycopg call it mogrify?

    https://django-debug-toolbar.readthedocs.io/en/latest/panels... :

    > debug_toolbar.panels.sql.SQLPanel: SQL queries including time to execute and links to EXPLAIN each query

    But debug toolbars mostly don't work with APIs.

    https://github.com/django-query-profiler/django-query-profil... :

    > Django query profiler - one profiler to rule them all. Shows queries, detects N+1 and gives recommendations on how to resolve them

    https://github.com/jazzband/django-silk :

    > Silk is a live profiling and inspection tool for the Django framework. Silk intercepts and stores HTTP requests and database queries before presenting them in a user interface for further inspection

  • Norm

    The SQL generation library you already know how to use. (by justinvanwinkle)

  • sqlc

    Generate type-safe code from 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).

  • sql-athame

    Python tool for slicing and dicing SQL

  • I had my own take on this concept[1], though with considerably less language magic involved. I imagine there's a lot of these kind of things running around. My criteria were:

    a) let me write actual SQL, not a python DSL that generates SQL

    b) be placeholder-safe

    c) be composable

    [1] https://github.com/bdowning/sql-athame

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts