sqldef VS octosql

Compare sqldef vs octosql and see what are their differences.

octosql

OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL. (by cube2222)
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.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
sqldef octosql
9 34
1,815 4,699
1.5% -
9.3 1.2
5 days ago 8 days ago
Go Go
GNU General Public License v3.0 or later Mozilla Public License 2.0
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.

sqldef

Posts with mentions or reviews of sqldef. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-02-02.
  • We built our customer data warehouse all on Postgres
    16 projects | news.ycombinator.com | 2 Feb 2024
    Thanks! Yeah definitely agree that building out declarative table management for Postgres would be a major effort. A few open source projects I've seen in that area include:

    https://github.com/sqldef/sqldef (Go)

    https://github.com/bikeshedder/tusker (Python but being ported to Rust)

    https://github.com/tyrchen/renovate (Rust)

    https://github.com/blainehansen/postgres_migrator (Rust)

    Some of these are based on parsing SQL, and others are based on running the CREATEs in a temporary location and introspecting the result.

    The schema export side can be especially tricky for Postgres, since it lacks a built-in equivalent to MySQL's SHOW CREATE TABLE. So most of these declarative pg tools shell out to pg_dump, or require the user to do so. But sqldef actually implements CREATE TABLE dumping in pure Golang if I recall correctly, which is pretty cool.

    There's also the question of implementing the table diff logic from scratch, vs shelling out to another tool or using a library. For the latter path, there's a nice blog post from Supabase about how they evaluated the various options: https://supabase.com/blog/supabase-cli#choosing-the-best-dif...

  • Prisma laying off 28% staff
    5 projects | news.ycombinator.com | 22 Jan 2023
    If you wish to auto-generate migrations, there are declarative schema change tools available for most relational databases. I'm the creator of Skeema [1] which provides them for MySQL, but there are options for other DBs too [2][3][4].

    Prisma's migration system actually partially copied Skeema's design, while giving credit in a rather odd fashion which really rubbed me the wrong way: "The workflow of working with temporary databases and introspecting it to determine differences between schemas seems to be pretty common, this is for example what skeema does." [5]

    While I doubt I was the first person to ever use that technique, I absolutely didn't copy it from anywhere, and it was never "pretty common". I'm not aware of any other older schema change systems that work this way.

    [1] https://www.skeema.io

    [2] https://github.com/djrobstep/migra

    [3] https://github.com/k0kubun/sqldef

    [4] https://david.rothlis.net/declarative-schema-migration-for-s...

    [5] https://github.com/prisma/prisma-engines/blob/6be410e/migrat...

  • Allow Cloudflare D1 to be used like an O/R mapper with type-safe
    8 projects | dev.to | 15 Jan 2023
    By the way, I have also made a repository that uses sqldef as a migration tool to make migration as easy as possible, so please take a look at it.
  • AWS open source news and updates, #116
    1 project | dev.to | 10 Jun 2022
    sqldef-gitops-cdk sqldef is an open source idempotent schema management for MySQL, PostgreSQL, and others. This repo provides a GitOps approach using AWS CDK of how you can approach database table migration.
  • Sqldef: Idempotent Schema Management for MySQL, PostgreSQL, SQLite, SQL Server
    1 project | news.ycombinator.com | 3 May 2022
  • Sqldef: Idempotent schema management for MySQL, PostgreSQL, SQLite, and more
    1 project | news.ycombinator.com | 26 Feb 2022
  • Migra: Like Diff but for PostgreSQL Schemas
    7 projects | news.ycombinator.com | 25 Feb 2022
    I work heavily in this space and can add some more details :)

    Tusker actually uses migra to power its functionality: https://github.com/bikeshedder/tusker#how-does-it-work

    Tusker's flow is somewhat similar to sqldef https://github.com/k0kubun/sqldef , although the internal mechanics are quite different. Migra (and therefore Tusker) executes the SQL, introspects it, and diffs the introspected in-memory representation -- in other words, using the database directly as the canonical parser. In contrast, sqldef parses the SQL itself, builds an in-memory representation based on that, and then does the diff that way.

    I'm the author of Skeema https://www.skeema.io which provides a similar declarative workflow for MySQL and MariaDB schema changes. Skeema uses an execute-and-introspect approach similar to Migra/Tusker, although each object is split out into its own .sql file for easier management in version control, with a multi-level directory hierarchy if you have multiple database instances and multiple schemas.

    Skeema was conceptually inspired by Facebook's internal database schema change flow, as FB has used declarative schema management submission/review/execution company-wide for over a decade now. Skeema actually predates both Migra and sqldef slightly, although it did not influence them, all were developed separately.

    In turn, Prisma Migrate and Vitess/PlanetScale declarative migrations were directly inspired by Skeema's approach, paradigms, and/or even direct use of source code in Vitess's case. (Although they're finally moving to a parser-based approach instead, which I recommended they do over a year ago, as it makes more sense for their use-case -- their whole product inherently requires a thorough SQL parser anyway...)

  • MariaDB to go public at $672M valuation
    3 projects | news.ycombinator.com | 1 Feb 2022
    Thanks! I know of a couple Postgres tools that work in a declarative fashion: migra [1] and sqldef [2].

    Migra is Postgres-specific. Its model is similar to Skeema's, in that the desired-state CREATEs are run in a temporary location and then introspected, to build an in-memory understanding of the desired state which can be diff'ed against the current actual state. (This approach was also borrowed by Prisma Migrate [3]). In this manner, the tool doesn't need a SQL parser, instead relying on the real DBMS to guarantee the CREATE is interpreted correctly with your exact DBMS version/flavor/settings.

    In contrast, sqldef supports multiple databases, including Postgres and MySQL (among others). Unlike other tools, it uses a SQL parser-based approach to build its in-memory understanding of the desired state. As a DB professional, personally this approach scares me a bit, given the amount of nonstandard stuff in each DBMS's SQL dialect. But I'm inherently biased on this topic. And I will note sqldef's author is a core Ruby committer and JIT author, and is extremely skilled at parsers.

    [1] https://databaseci.com/docs/migra

    [2] https://github.com/k0kubun/sqldef

    [3] https://github.com/prisma/prisma-engines/blob/main/migration...

  • Why Google Treats SQL Like Code and You Should Too
    4 projects | news.ycombinator.com | 13 Jan 2022
    Declarative schema management tools make this much easier. The concept is your schema repo just stores CREATE statements, and the schema management tool knows how to generate DDL to transition between the current state in your DB and the desired state in your repo.

    I'm the author of declarative schema management tool skeema (https://www.skeema.io, for MySQL / MariaDB). Some other options in this space are sqldef (https://github.com/k0kubun/sqldef, for MySQL or Postgres) and migra (https://github.com/djrobstep/migra, for Postgres). In MS SQL Server, SSDT DACPACs are also somewhat similar.

octosql

Posts with mentions or reviews of octosql. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-07-01.
  • Wazero: Zero dependency WebAssembly runtime written in Go
    12 projects | news.ycombinator.com | 1 Jul 2023
    Never got it to anything close to a finished state, instead moving on to doing the same prototype in llvm and then cranelift.

    That said, here's some of the wazero-based code on a branch - https://github.com/cube2222/octosql/tree/wasm-experiment/was...

    It really is just a very very basic prototype.

  • Analyzing multi-gigabyte JSON files locally
    14 projects | news.ycombinator.com | 18 Mar 2023
  • DuckDB: Querying JSON files as if they were tables
    9 projects | news.ycombinator.com | 3 Mar 2023
    This is really cool!

    With their Postgres scanner[0] you can now easily query multiple datasources using SQL and join between them (i.e. Postgres table with JSON file). Something I strived to build with OctoSQL[1] before.

    It's amazing to see how quickly DuckDB is adding new features.

    Not a huge fan of C++, which is right now used for authoring extensions, it'd be really cool if somebody implemented a Rust extension SDK, or even something like Steampipe[2] does for Postgres FDWs which would provide a shim for quickly implementing non-performance-sensitive extensions for various things.

    Godspeed!

    [0]: https://duckdb.org/2022/09/30/postgres-scanner.html

    [1]: https://github.com/cube2222/octosql

    [2]: https://steampipe.io

  • Show HN: ClickHouse-local – a small tool for serverless data analytics
    13 projects | news.ycombinator.com | 5 Jan 2023
    Congrats on the Show HN!

    It's great to see more tools in this area (querying data from various sources in-place) and the Lambda use case is a really cool idea!

    I've recently done a bunch of benchmarking, including ClickHouse Local and the usage was straightforward, with everything working as it's supposed to.

    Just to comment on the performance area though, one area I think ClickHouse could still possibly improve on - vs OctoSQL[0] at least - is that it seems like the JSON datasource is slower, especially if only a small part of the JSON objects is used. If only a single field of many is used, OctoSQL lazily parses only that field, and skips the others, which yields non-trivial performance gains on big JSON files with small queries.

    Basically, for a query like `SELECT COUNT(*), AVG(overall) FROM books.json` with the Amazon Review Dataset, OctoSQL is twice as fast (3s vs 6s). That's a minor thing though (OctoSQL will slow down for more complicated queries, while for ClickHouse decoding the input is and remains the bottleneck).

    [0]: https://github.com/cube2222/octosql

  • Steampipe – Select * from Cloud;
    13 projects | news.ycombinator.com | 30 Sep 2022
    To add somewhat of a counterpoint to the other response, I've tried the Steampipe CSV plugin and got 50x slower performance vs OctoSQL[0], which is itself 5x slower than something like DataFusion[1]. The CSV plugin doesn't contact any external API's so it should be a good benchmark of the plugin architecture, though it might just not be optimized yet.

    That said, I don't imagine this ever being a bottleneck for the main use case of Steampipe - in that case I think the APIs themselves will always be the limiting part. But it does - potentially - speak to what you can expect if you'd like to extend your usage of Steampipe to more than just DevOps data.

    [0]: https://github.com/cube2222/octosql

    [1]: https://github.com/apache/arrow-datafusion

    Disclaimer: author of OctoSQL

  • Go runtime: 4 years later
    11 projects | news.ycombinator.com | 26 Sep 2022
    Actually, folks just use gRPC or Yaegi in Go.

    See Terraform[0], Traefik[1], or OctoSQL[2].

    Although I agree plugins would be welcome, especially for performance reasons, though also to be able to compile and load go code into a running go process (JIT-ish).

    [0]: https://github.com/hashicorp/terraform

    [1]: https://github.com/traefik/traefik

    [2]: https://github.com/cube2222/octosql

    Disclaimer: author of OctoSQL

  • Run SQL on CSV, Parquet, JSON, Arrow, Unix Pipes and Google Sheet
    9 projects | news.ycombinator.com | 24 Sep 2022
  • Beginner interested in learning SQL. Have a few question that I wasn’t able to find on google.
    3 projects | /r/SQL | 6 Aug 2022
    Through more magic, you COULD of course use stuff like Spark, or easier with programs like TextQL, sq, OctoSQL.
  • How I Used DALL·E 2 to Generate The Logo for OctoSQL
    1 project | /r/programming | 2 Aug 2022
    The logo was created for OctoSQL and in the article you can find a lot of sample phrase-image combinations, as it describes the whole path (generation, variation, editing) I went down. Let me know what you think!
  • How I Used DALL·E 2 to Generate the Logo for OctoSQL
    3 projects | news.ycombinator.com | 2 Aug 2022
    Hey, author here, happy to answer any questions!

    The logo was created for OctoSQL[0] and in the article you can find a lot of sample phrase-image combinations, as it describes the whole path (generation, variation, editing) I went down. Let me know what you think!

    [0]:https://github.com/cube2222/octosql

What are some alternatives?

When comparing sqldef and octosql you can also consider the following projects:

migra - Like diff but for PostgreSQL schemas

duckdb - DuckDB is an in-process SQL OLAP Database Management System

bytebase - The GitLab/GitHub for database DevOps. World's most advanced database DevOps and CI/CD for Developer, DBA and Platform Engineering teams.

q - q - Run SQL directly on delimited files and multi-file sqlite databases

OpenDBDiff - A database comparison tool for Microsoft SQL Server 2005+ that reports schema differences and creates a synchronization script.

trdsql - CLI tool that can execute SQL queries on CSV, LTSV, JSON, YAML and TBLN. Can output to various formats.

skeema - Declarative pure-SQL schema management for MySQL and MariaDB

sqlitebrowser - Official home of the DB Browser for SQLite (DB4S) project. Previously known as "SQLite Database Browser" and "Database Browser for SQLite". Website at:

SQLMonitor - SQL Server monitor, manages sql server performance, monitor sql server processes and jobs, analyze performance, analyse system, object version control, view executing sql query, kill process / job, object explorer, database shrink/log truncate/backup/detach/attach.

sqlite-utils - Python CLI utility and library for manipulating SQLite databases

prisma-engines - 🚂 Engine components of Prisma ORM

textql - Execute SQL against structured text like CSV or TSV