PostgreSQL VS SQLAlchemy

Compare PostgreSQL vs SQLAlchemy and see what are their differences.

PostgreSQL

Mirror of the official PostgreSQL GIT repository. Note that this is just a *mirror* - we don't work with pull requests on github. To contribute, please see https://wiki.postgresql.org/wiki/Submitting_a_Patch (by postgres)

SQLAlchemy

The Database Toolkit for Python (by sqlalchemy)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
PostgreSQL SQLAlchemy
403 122
14,445 8,611
3.1% 3.2%
9.9 9.8
4 days ago 5 days ago
C Python
GNU General Public License v3.0 or later MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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.

PostgreSQL

Posts with mentions or reviews of PostgreSQL. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-19.
  • From zero to hero: using SQL databases in Node.js made easy
    3 projects | dev.to | 19 Mar 2024
    Node.js, MySQL and PostgreSQL servers installed on your machine
  • I Deployed My Own Cute Lil’ Private Internet (a.k.a. VPC)
    8 projects | dev.to | 18 Mar 2024
    Each app’s front end is built with Qwik and uses Tailwind for styling. The server-side is powered by Qwik City (Qwik’s official meta-framework) and runs on Node.js hosted on a shared Linode VPS. The apps also use PM2 for process management and Caddy as a reverse proxy and SSL provisioner. The data is stored in a PostgreSQL database that also runs on a shared Linode VPS. The apps interact with the database using Drizzle, an Object-Relational Mapper (ORM) for JavaScript. The entire infrastructure for both apps is managed with Terraform using the Terraform Linode provider, which was new to me, but made provisioning and destroying infrastructure really fast and easy (once I learned how it all worked).
  • How to dump and restore a Postgres DB with new table ownership
    2 projects | dev.to | 14 Mar 2024
    I've used MySQL for years. But recently, I found myself working PostgreSQL and simple things like dumping and restoring a database are different enough that I decided to document the process. It's straightforward enough once I knew how.
  • Test Driving a Rails API - Part One
    11 projects | dev.to | 11 Mar 2024
    A running Rails application needs a database to connect to. You may already have your database of choice installed, but if not, I recommend PostgreSQL, or Postgres for short. On a Mac, probably the easiest way to install it is with Posrgres.app. Another option, the one I prefer, is to use Homebrew. With Homebrew installed, this command will install PostgreSQL version 16 along with libpq:
  • Um júnior e um teste técnico: The battle.
    5 projects | dev.to | 3 Mar 2024
    PostgreSQL
  • How to choose the right type of database
    15 projects | dev.to | 28 Feb 2024
    PostgreSQL: Offers a robust feature set and strong compliance with SQL standards, making it suitable for a wide range of applications, from simple to complex, particularly where data integrity and extensibility are key.
  • NoSQL Postgres: Add MongoDB compatibility to your Supabase projects with FerretDB
    6 projects | dev.to | 23 Feb 2024
    FerretDB is an open source document database that adds MongoDB compatibility to other database backends, such as Postgres and SQLite. By using FerretDB, developers can access familiar MongoDB features and tools using the same syntax and commands for many of their use cases.
  • Preventing SQL injection attacks in Node.js
    6 projects | dev.to | 22 Feb 2024
    To better understand how SQL injection works, let's quickly create a vulnerable app using Node.js, Express, and a PostgreSQL database. The application takes user input from a form, constructs a SQL query, and executes it against the database to fetch some data.
  • Full Stack Chat App with Socket.io
    3 projects | dev.to | 16 Feb 2024
    We'll use PostgreSQL, and first of all, you need to install PostgreSQL if you haven't installed it yet. https://www.postgresql.org/
  • Rust GraphQL APIs for NodeJS Developers: Introduction
    7 projects | dev.to | 8 Feb 2024
    In my usual NodeJS tech stack, which includes GraphQL, NestJS, SQL (predominantly PostgreSQL with MikroORM), I encountered these limitations. To overcome them, I've developed a new stack utilizing Rust, which still offers some ease of development:

SQLAlchemy

Posts with mentions or reviews of SQLAlchemy. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-12-18.
  • Introducing Flama for Robust Machine Learning APIs
    11 projects | dev.to | 18 Dec 2023
    Besides, flama also provides support for SQL databases via SQLAlchemy, an SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL. Finally, flama also provides support for HTTP clients to perform requests via httpx, a next generation HTTP client for Python.
  • Unlocking efficient authZ with Cerbos’ Query Plan
    5 projects | dev.to | 6 Sep 2023
    To simplify this process, Cerbos developers have come up with adapters for popular Object-Relational Mapping (ORM) frameworks. You can check out for more details on the query plan repo - which also contains adapters for Prisma and SQLAlchemy - as well as a fully functioning application using Mongoose as its ORM.
  • Python: Just Write SQL
    21 projects | news.ycombinator.com | 14 Aug 2023
    That above pattern is one I've seen people do even recently, using the "select().c" attribute which from very early versions of SQLAlchemy is defined as "the columns from a subquery of the SELECT" ; this usage began raising deprecation warnings in 1.4 and is fully removed in 2.0 as it was a remnant of a much earlier version of SQLAlchemy. it will do exactly as you say, "make a subquery for each filter condition".

    the moment you see SQLAlchemy doing something you see that seems "asinine", send an example to https://github.com/sqlalchemy/sqlalchemy/discussions and I will clarify what's going on, correct the usage so that the query you have is what you expect, and quite often we will add new warnings or documentation when we see people doing things we didn't anticipate.

  • A steering council note about making the global
    3 projects | news.ycombinator.com | 29 Jul 2023
    The creator and lead maintainer of SQLAlchemy, one of the most popular and most used Python library for accessing databases (who doesn't?) gave a rather interesting response to PEP703.

    If this doesn't ring any alarm bells I don't know what will.

    > Basically for the moment the GIL-less idea would likely be burdensome for us and the fact that it's only an "option" seems to strongly imply major compatibility issues that we would not prefer.

    https://github.com/sqlalchemy/sqlalchemy/discussions/10002#d...

  • More public SQL-queryable databases?
    3 projects | /r/datasets | 10 Jul 2023
    Recently I discovered BigQuery public datasets - just over 200 datasets available for directly querying via SQL. I think this is a great thing! I can connect these direct to an analytics platform (we use Apache Superset which uses Python SQLAlchemy under the hood) for example and just start dashboarding.
  • Day 46-47: Beginner FastAPI Series - Part 3
    2 projects | dev.to | 8 Jun 2023
    Our tool we're going to be using for interfacing with the SQLite database is SQLAlchemy, a SQL toolkit that provides a unified API for various relational databases. If you installed FastAPI with pip install "fastapi[all]", SQLAlchemy is already part of your setup. but if you opted for FastAPI alone, you would need to install SQLAlchemy separately with pip install sqlalchemy.
  • Is there a Python module that can store data between runs?
    2 projects | /r/learnpython | 14 Apr 2023
  • Starlite updates March '22 | 2.0 is coming
    14 projects | /r/Python | 26 Mar 2023
    This feature is yet to be released, but it will allow you to seamlessly use data modelled with for example Pydantic, SQLAlchemy, msgspec or dataclasses in your route handlers, without the need for an intermediary model; The conversion will be handled by the specific DTO "backend" implementation. This new paradigm also makes it trivial to add support for any such modelling library, by simply implementing an appropriate backend.
  • Reddit Recap Series: Backend Performance Tuning
    4 projects | /r/RedditEng | 13 Mar 2023
    The second problem was caused by the pgBouncer setup. pgBouncer is an impostor that owns several dozen of real PostgreSQL connections, but pretends that it has thousands of them available for the backend services. Similar to fractional-reserve banking. So, it needs a way to find out when the real DB connection becomes free and can be used by another service. Our pgBouncer was configured as pool_mode=transaction. I.e., it detected when the current transaction was over, and returned the PostgreSQL connection into the pool, making it available to other users. However, this mode was found to not work well with the code that was using SQLAlchemy: committing the current transaction immediately started a new one. So, the expensive connection between pgBouncer and PostgreSQL remained checked out as long as the connection from service to pgBouncer remained open (forever, or close to that).
  • Domain model with SQLAlchemy
    2 projects | dev.to | 16 Feb 2023
    In this blog post, we will explore the power of SQLAlchemy, a popular ORM library in Python, to model our domain objects.

What are some alternatives?

When comparing PostgreSQL and SQLAlchemy you can also consider the following projects:

tortoise-orm - Familiar asyncio ORM for python, built with relations in mind

PonyORM - Pony Object Relational Mapper

Peewee - a small, expressive orm -- supports postgresql, mysql, sqlite and cockroachdb

Orator - The Orator ORM provides a simple yet beautiful ActiveRecord implementation.

prisma-client-py - Prisma Client Python is an auto-generated and fully type-safe database client designed for ease of use

pyDAL - A pure Python Database Abstraction Layer

GINO - GINO Is Not ORM - a Python asyncio ORM on SQLAlchemy core.

psycopg2 - PostgreSQL database adapter for the Python programming language

pydantic - Data validation using Python type hints

sqlmodel - SQL databases in Python, designed for simplicity, compatibility, and robustness.

ClickHouse - ClickHouse® is a free analytics DBMS for big data