This topic provides instructions for installing, running, and modifying the go netsuiteodbc driver for connecting to NetSuite ODBC databases through unixodbc.
This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with NetSuite, Oracle, or any of its subsidiaries or its affiliates. The official NetSuite website can be found at https://www.netsuite.com.
The names NetSuite and Oracle as well as related names, marks, emblems and images are registered trademarks of their respective owners.
The following software packages are required to use the go unixodbc driver.
The latest driver requires the Go language 1.20 or higher.
This connector requires go unixodbc and it's corresponding dependencies.
The NetSuite ODBC driver must be installed and configured with unixodbc according to NetSuite documentation.
To connect to the ODBC database with token based authentication, use netsuiteodbc.NewConnectionStringer with a netsuiteodbc.Config to create a dynamic connection string for use in unixodbc.Connector:
package main
import (
"github.com/ninthclowd/unixodbc"
"github.com/ninthclowd/netsuiteodbc"
"database/sql"
"time"
)
func main() {
//connect to the database using TBA
db = sql.OpenDB(&unixodbc.Connector{
ConnectionString: netsuiteodbc.NewConnectionStringer(netsuiteodbc.Config{
ConnectionString: "DSN=NetSuite",
ConsumerKey: "<hex consumer key>",
ConsumerSecret: "<hex consumer secret>",
TokenId: "<hex token id>",
TokenSecret: "<hex token secret>",
AccountId: "123456_SB1",
}),
})
// set connection timeout to expected lifetime of token
db.SetConnMaxLifetime(5 * time.Minute)
}
The developer notes are hosted with the source code on GitHub.