Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge. Learn more →
Top 23 Go SQL Projects
-
tidb
TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://tidbcloud.com/free-trial
Project mention: TiDB: Open-source, cloud-native, distributed, MySQL compatible database | news.ycombinator.com | 2023-08-30 -
Project mention: Is it bad to create a publicly accessible RDS database for my serverless web app? | /r/aws | 2023-08-11
For example, when you create a serverless postgres database with a platform like CockroachDB or Neon, you effectively get a connection string with a strong password. Anyone can connect to your database from anywhere so long as they have the right connection string. There are no security settings in these services to change this behavior.
-
InfluxDB
Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.
-
Project mention: SQLedge: Replicate Postgres to SQLite on the Edge | news.ycombinator.com | 2023-08-09
#. SQLite WAL mode
From https://www.sqlite.org/isolation.html https://news.ycombinator.com/item?id=32247085 :
> [sqlite] WAL mode permits simultaneous readers and writers. It can do this because changes do not overwrite the original database file, but rather go into the separate write-ahead log file. That means that readers can continue to read the old, original, unaltered content from the original database file at the same time that the writer is appending to the write-ahead log
#. superfly/litefs: aFUSE-based file system for replicating SQLite https://github.com/superfly/litefs
#. sqldiff: https://www.sqlite.org/sqldiff.html https://news.ycombinator.com/item?id=31265005
#. dolthub/dolt: https://github.com/dolthub/dolt
> Dolt can be set up as a replica of your existing MySQL or MariaDB database using standard MySQL binlog replication. Every write becomes a Dolt commit. This is a great way to get the version control benefits of Dolt and keep an existing MySQL or MariaDB database.
#. pganalyze/libpg_query: https://github.com/pganalyze/libpg_query :
> C library for accessing the PostgreSQL parser outside of the server environment
#. Ibis + Substrait [ + DuckDB ]
> ibis strives to provide a consistent interface for interacting with a multitude of different analytical execution engines, most of which (but not all) speak some dialect of SQL.
> Today, Ibis accomplishes this with a lot of help from `sqlalchemy` and `sqlglot` to handle differences in dialect, or we interact directly with available Python bindings (for instance with the pandas, datafusion, and polars backends).
> [...] `Substrait` is a new cross-language serialization format for communicating (among other things) query plans. It's still in its early days, but there is already nascent support for Substrait in Apache Arrow, DuckDB, and Velox.
#. benbjohnson/postlite: https://github.com/benbjohnson/postlite
> postlite is a network proxy to allow access to remote SQLite databases over the Postgres wire protocol. This allows GUI tools to be used on remote SQLite databases which can make administration easier.
> The proxy works by translating Postgres frontend wire messages into SQLite transactions and converting results back into Postgres response wire messages. Many Postgres clients also inspect the pg_catalog to determine system information so Postlite mirrors this catalog by using an attached in-memory database with virtual tables. The proxy also performs minor rewriting on these system queries to convert them to usable SQLite syntax.
> Note: This software is in alpha. Please report bugs. Postlite doesn't alter your database unless you issue INSERT, UPDATE, DELETE commands so it's probably safe. If anything, the Postlite process may die but it shouldn't affect your database.
#. > "Hosting SQLite Databases on GitHub Pages" (2021) re: sql.js-httpvfs, DuckDB https://news.ycombinator.com/item?id=28021766
#. awesome-db-tools https://github.com/mgramin/awesome-db-tools
-
-
go-sql-driver/mysql
Go MySQL Driver is a MySQL driver for Go's (golang) database/sql package (by go-sql-driver)
IDE: use whatever make you productive. I personally use vscode. VCS: git, as golang communities use github heavily as base for many libraries. AFAIK Linter: use staticcheck for linting as it looks like mostly used linting tool in go, supported by many also. In Vscode it will be recommended once you install go plugin. Libraries/Framework: actually the standard libraries already included many things you need, decent enough for your day-to-day development cycles(e.g. `net/http`). But here are things for extra: - Struct fields validator: validator - Http server lib: chi router , httprouter , fasthttp (for non standard http implementations, but fast) - Web Framework: echo , gin , fiber , beego , etc - Http client lib: most already covered by stdlib(net/http), so you rarely need extra lib for this, but if you really need some are: resty - CLI: cobra - Config: godotenv , viper - DB Drivers: sqlx , postgre , sqlite , mysql - nosql: redis , mongodb , elasticsearch - ORM: gorm , entgo , sqlc(codegen) - JS Transpiler: gopherjs - GUI: fyne - grpc: grpc - logging: zerolog - test: testify , gomock , dockertest - and many others you can find here
-
First of all, thank you for SQLAlchemy! If I ever had to make a final choice in how I would interact with a database for a very large project that involves a considerable dev team, I would always bet on SQLAlchemy. Not that I would necessarily like all aspects of it, but when it comes to Python and SQL - “Nobody ever got fired for picking SQLAlchemy.”.
With that out of the way, despite ORMs doing much more than "just writing SQL", it is exactly on that point that I flinch: Most devs should be exposed to SQL. And if your project allows you to build around simple enough abstractions so that you aren't reinventing the wheel, you should definitely be writing SQL. Especially if you don't know SQL yet - which is the growing case of new devs coming into the job market.
You can achieve a lot with SQlAlchemy Core, a tool that I absolutely recommend, but my post is just a simple alternative to get developers to think about their approach. If that results in some devs reconsidering using "full fat" SQLAlchemy and to try SQLAlchemy Core, that's a win for me!
Your gist tries to highlight the difficulty of doing certain things without an ORM. Migrations (as just 1 example) doesn't need to be hard, simple tools like flyway, or migrate (https://github.com/golang-migrate/migrate) achieve a similar result (while also keeping you on the path of writing SQL!). Deep and complex relationships between objects also don't need to be hard - typically people approach this subject with a requirement to be very flexible in the way they want to build queries and objects, but that to me in a sign that maybe they should reconsider their business logic AND reconsider that, just maybe, their project doesn't require all that flexibility, it is fairly straightforward to extend objects and introduce some more complex representations as and when it is needed - will all of this make me write code faster? Absolutely not. That is why you have spent so much time perfecting SQLAlchemy, but then again, I am not advocating for devs to go and replace their usage of ORMs, just presenting an alternative that may or may not fit their needs for a new project + give devs the chance to learn something that the ORM might have taken away.
-
Project mention: Open-sourcing SQX, a way to build flexible database models in Go | news.ycombinator.com | 2023-09-02
This does look like it's a little bit better than a lot of the other options in the Go ecosystem for database access, but this introduction misses something important: what SQL dialects does this support? It appears to be partly a wrapper around Squirrel. Squirrel is not new (and apparently also not maintained?) but I actually have no idea which and how much of each SQL dialect Squirrel supports.
Every time I see SQL and Go stuff, I feel literally obligated to introduce people to sqlc. That said, sqlc only has good support for PostgreSQL, and you'd have to generate code for each dialect... so that's something worth considering. (I still find it to be one of my favorite SQL tools, even with its issues.)
-
Mergify
Updating dependencies is time-consuming.. Solutions like Dependabot or Renovate update but don't merge dependencies. You need to do it manually while it could be fully automated! Add a Merge Queue to your workflow and stop caring about PR management & merging. Try Mergify for free.
-
immudb
immudb - immutable database based on zero trust, SQL/Key-Value/Document model, tamperproof, data change history
-
Project mention: xo/usql: Universal command-line interface for SQL databases | /r/devel | 2023-06-08
-
Try this
-
Project mention: Are "Infrastructure as Code" limited to "Infrastructure" only? | /r/kubernetes | 2023-09-19
Now there are more subdivided practice: * Policy as Code: Sentinel, OPA * Database as Code: bytebase * AppConfiguration as Code: KusionStack, Acorn * ...... (Welcome to add more)
-
steampipe
Use SQL to instantly query your cloud services (AWS, Azure, GCP and more). Open source CLI. No DB required.
I'm a lead on the Steampipe project, so just wanted to share a vote for that :-). It's backed by Turbot, we've been a key player in the cloud security space since 2014.
-
Project mention: How do you unit-test code that reaches out to the db, without introducing interfaces everywhere? | /r/golang | 2023-08-16
-
Project mention: Dockerized RESTful API Application in Go: CRUD,ORM,Logs,Migrations,Validations | /r/programming | 2023-02-12
Might have been this one but I can't be sure https://github.com/go-pg/pg
-
Congrats!! How does it compare to the ELT space and the modern data stack where you have ingestion/storage/visualization layers decoupled?
Asking as the founder of CloudQuery (https://github.com/cloudquery/cloudquery), Saw Datasette quite a few times around data exploration but curious to hear about the most popular use-cases of Datasette!
-
octosql
OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.
Project mention: Wazero: Zero dependency WebAssembly runtime written in Go | news.ycombinator.com | 2023-07-01Never 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.
-
-
xo
Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server (by xo)
Project mention: Open-sourcing SQX, a way to build flexible database models in Go | news.ycombinator.com | 2023-09-02i like xo's approach https://github.com/xo/xo but it is as is. I would love if something similar comes along that is used by db practititoners that is actively used and supported.
-
Project mention: DuckDB: Querying JSON files as if they were tables | news.ycombinator.com | 2023-03-03
Welcome to the gang! :)
-
upper.io/db
Data access layer for PostgreSQL, CockroachDB, MySQL, SQLite and MongoDB with ORM-like features.
-
mergestat-lite
Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. 🔍 📊
-
-
Project mention: [Golang] Super Graph GraphQL au compilateur SQL renommé GraphJin et prend maintenant en charge MySQL | /r/enfrancais | 2023-04-27
-
SonarQube
Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
Go SQL related posts
- Open-sourcing SQX, a way to build flexible database models in Go
- Is it bad to create a publicly accessible RDS database for my serverless web app?
- The "preferred" way of mapping SQL results in Golang is honestly, subjectively, awful, how to deal with this
- Linux surpasses the Mac among Steam gamers
- How are y'all that are using raw sql doing DB Migrations?
- Launch HN: PeerDB (YC S23) – Fast, Native ETL/ELT for Postgres
- Auto generate go code for API endpoints from DAO functions?
-
A note from our sponsor - InfluxDB
www.influxdata.com | 24 Sep 2023
Index
What are some of the best open-source SQL projects in Go? This list will help you:
Project | Stars | |
---|---|---|
1 | tidb | 34,864 |
2 | cockroach | 27,812 |
3 | dolt | 15,532 |
4 | rqlite | 14,015 |
5 | go-sql-driver/mysql | 13,673 |
6 | migrate | 12,238 |
7 | sqlc | 9,096 |
8 | immudb | 8,353 |
9 | usql | 8,222 |
10 | go-clean-arch | 8,030 |
11 | bytebase | 6,848 |
12 | steampipe | 5,562 |
13 | go-sqlmock | 5,478 |
14 | go-pg | 5,469 |
15 | cloudquery | 5,137 |
16 | octosql | 4,589 |
17 | goose | 4,370 |
18 | xo | 3,451 |
19 | dsq | 3,397 |
20 | upper.io/db | 3,377 |
21 | mergestat-lite | 3,351 |
22 | sql-migrate | 2,937 |
23 | graphjin | 2,735 |