Using SQL Database in Go Applications
Chris "Mac" McEniry
Many applications work on some set of local data. Even some command line applications need to keep data across invocations. Flat files in a columnar or JSON format work for many cases. However, it can get to the point where a more structured approach can make life easier. SQL databases are the typical next stopping point for a structured approach to data.
Go has a generic interface around SQL with database/sql in the standard library. The interface supports drivers which provide the backing to common database technologies. A list of common drivers is available on the Go wiki: https://github.com/golang/go/wiki/SQLDrivers. While most of these are dependent on an external data service, one, SQLite, is not.
To access this content, please purchase a USENIX Membership.