Go언어 내장형 SQL 데이터베이스

프로그래밍 2022. 12. 19. 18:27 Posted by UnHa Kim

Java의 경우 프로그램 안에 SQL 데이터베이스를 내장하는 선택지가 몇 개나 존재한다.

(HSQLDB, H2 및 Apache Derby등등)

 

Go언어의 경우 (NoSQL, K/V 저장소는 있어도) 마땅한 내장형 SQL 데이터베이스가 없어서 아쉽다고 느꼈는 데, 알고보니 약 2년 전에 이미 Go언어로 작성된 SQL 데이터베이스가 작성되었는 데, 모르고 있던 것일 뿐이었다.

검색의 생활화가 시급하다는 것 또 다시 깨닫는다.

 

C언어로 작성된 sqlite를 Go언어로 포팅한 것인데, 배포 편의성을 감안하면 아주 유용할 것 같다.

 

https://gitlab.com/cznic/sqlite

 

cznic / sqlite · GitLab

Package sqlite is a CGo-free port of SQLite/SQLite3. SQLite is an in-process implementation of a self-contained, serverless, zero-configuration, transactional SQL database engine.

gitlab.com

 

https://pkg.go.dev/modernc.org/sqlite

 

sqlite package - modernc.org/sqlite - Go Packages

sqlite Package sqlite is a cgo-free port of SQLite. Although you could see mattn's driver (github.com/mattn/go-sqlite3) in go.mod file, we import it for tests only. SQLite is an in-process implementation of a self-contained, serverless, zero-configuration,

pkg.go.dev