Database API and Drivers
In order to work with databases, there is something called the "pure" Go approach, which means Go has an API that allows you to use different drivers to connect to databases. The API comes from the database/sql
package, and the drivers can be of two types. There is native support for a wide variety of drivers, which can be found on the official GitHub page (https://packt.live/2LMzcC4), and there are third-party drivers that need additional packages to function, such as the SQLlite3
package, which requires you to have GCC
installed because it is a pure C implementation.
Note
GCC is a compiler system produced by the GNU Project. It takes your source code and translates it to machine code so that your computer can run the application.
Here is a list of a couple of drivers:
- MySQL (https://packt.live/38zk9Fw)
- Oracle (https://packt.live/34cxwrP)
- ODBC (https://packt.live/2EfETV8)
- Postgres (https://packt.live/35jKEwL)
The...