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) 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

Would love feedback – especially on SQL functions you'd want supported!

6 points sr-white 10 months ago 4 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton