@@ -31,9 +31,35 @@ A comprehensive, production-ready DuckDB driver for [GORM](https://gorm.io), bri
3131
3232### Install
3333
34+ ** Step 1:** Add the dependencies to your project:
35+
3436``` bash
35- go get -u gorm.io/driver/duckdb
3637go get -u gorm.io/gorm
38+ go get -u github.com/greysquirr3l/gorm-duckdb-driver
39+ ```
40+
41+ ** Step 2:** Add a ` replace ` directive to your ` go.mod ` file:
42+
43+ ``` go
44+ module your-project
45+
46+ go 1.21
47+
48+ require (
49+ gorm.io /driver/duckdb v1.0.0
50+ gorm.io /gorm v1.25.12
51+ )
52+
53+ // Replace directive to use this implementation
54+ replace gorm.io /driver/duckdb => github.com /greysquirr3l/gorm-duckdb-driver v0.2.4
55+ ```
56+
57+ > ** 📝 Note** : The ` replace ` directive is necessary because this driver uses the future official module path ` gorm.io/driver/duckdb ` but is currently hosted at ` github.com/greysquirr3l/gorm-duckdb-driver ` . This allows for seamless migration once this becomes the official GORM driver.
58+
59+ ** Step 3:** Run ` go mod tidy ` to update dependencies:
60+
61+ ``` bash
62+ go mod tidy
3763```
3864
3965### Connect to Database
@@ -57,6 +83,20 @@ db, err := gorm.Open(duckdb.New(duckdb.Config{
5783}), &gorm.Config {})
5884```
5985
86+ ### Alternative: Direct Import (Without Replace)
87+
88+ If you prefer to import directly without the replace directive:
89+
90+ ``` go
91+ import (
92+ duckdb " github.com/greysquirr3l/gorm-duckdb-driver"
93+ " gorm.io/gorm"
94+ )
95+
96+ // Usage remains the same
97+ db , err := gorm.Open (duckdb.Open (" :memory:" ), &gorm.Config {})
98+ ```
99+
60100## 🎨 Array Support (New!)
61101
62102DuckDB's powerful array types are now fully supported with type safety:
@@ -280,7 +320,7 @@ duckdb.EnableDataFormatExtensions(db) // parquet, csv, json, etc.
280320
281321## 🏗️ Architecture
282322
283- ```
323+ ``` ascii
284324┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
285325│ Your Go App │───▶│ GORM Driver │───▶│ DuckDB │
286326│ │ │ │ │ (Embedded) │
@@ -317,7 +357,7 @@ go test -v
317357
318358``` bash
319359cd example
320- go run main.go
360+ go run main.go # Run directly without building binary
321361```
322362
323363## 📄 License
@@ -335,7 +375,3 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
335375- 🐛 ** Issues** : [ GitHub Issues] ( https://github.com/greysquirr3l/gorm-duckdb-driver/issues )
336376- 💬 ** Discussions** : [ GitHub Discussions] ( https://github.com/greysquirr3l/gorm-duckdb-driver/discussions )
337377- 📖 ** Documentation** : [ pkg.go.dev] ( https://pkg.go.dev/gorm.io/driver/duckdb )
338-
339- ---
340-
341- ** Made with ❤️ for the Go and DuckDB communities**
0 commit comments