2 ms·
Show HN: Snowflake Emulator – Local Snowflake Development with Go and DuckDB
Hi HN! I built a Snowflake emulator for local development and testing.
Testing Snowflake code locally is frustrating – you need a real account (expensive) or mock everything (tedious). I wanted something that just works with the standard [gosnowflake](https://github.com/snowflakedb/gosnowflake https://github.com/snowflakedb/gosnowflake) driver or REST API.
snowflake-emulator fixes this by:
- Using DuckDB as the storage engine
- Auto-translating Snowflake SQL (IFF→IF, NVL→COALESCE, DATEADD, etc.)
- Supporting gosnowflake driver protocol – no code changes needed
- Providing REST API v2 – use from any language (Python, Node.js, etc.)
```go
dsn := "user:pass@localhost:8080/TEST_DB/PUBLIC?account=test&protocol=http"
db, _ := sql.Open("snowflake", dsn)
db.Query(`SELECT IFF(score >= 90, 'A', 'B') FROM users`)
```
```bash
docker run -p 8080:8080 ghcr.io/nnnkkk7/snowflake-emulator:latest
```
GitHub: https://github.com/nnnkkk7/snowflake-emulator https://github.com/nnnkkk7/snowflake-emulator
Would love feedback – especially on SQL functions you'd want supported!
- toggle-me 9mo agoNice! I'll give it a try!
- sr-white 9mo agoThank you!
- dmarwicke 9mo agohow well does the flatten() translation work in practice? every time i've used localstack or similar the queries work locally then break in subtle ways once deployed
- sr-white 9mo agoGood question! Currently FLATTEN does a simple translation to DuckDB's UNNEST, which works for basic array expansion but won't give you the full Snowflake output columns (SEQ, KEY, PATH, INDEX, VALUE, THIS) or the named parameter syntax (input => ...). That said, a more complete implementation is definitely doable — DuckDB has the primitives (unnest, generate_subscripts, json_each) to build this properly. If this is something you'd find useful, feel free to open an issue with your use case. Happy to prioritize it if there's demand!