github.com/thda/tds (go): Package tds is a pure Go Sybase ASE/IQ/RS driver for the database/sql package.  This is a beta release. This driver has yet to be battle tested on production workload. Version 1.0 will be released when this driver will be production ready  Requirements  Package installation is done via go-get:  It implements most of the database/sql functionalities. To connect to a sybase instance, import the package and use the regular database/sql APIs:  The connection string is pretty standard and uses the URL format:  The most common ones are:  Less frequently used ones:  Most of the database/sql APIs are implemented, with a major one missing: named parameters. Please use the question mark '?' as a placeholder for parameters :  Almost all of the sybase ASE datatypes are supported, with the exception of lob locators. The type mapping between the server and the go data types is as follows:  decimal/numeric/money/smallmoney data can be given as parameters using any of the go numerical types. However one should never use float64 if a loss of precision is not tolerated. To implement precise floating point numbers, this driver provides a "Num" datatype, which is a wrapper around big.Rat.  It implements the value.Scanner interface, you can thus instanciate it this way:  To access the underlying big.Rat:  Num also implements the stringer interface to pretty print its value. Please refer to the tds.Num godoc for more information.  This driver assumes by default that the client uses utf8 strings and will ask the server to convert back and forth to/from this charset.  If utf8 charset conversion is not supported on the server, and if the charset conversion is not supported by golang.org/x/text/encoding, you can add client-side character set conversion with the following code:  You will have to handle it yourself and use a charset supported by the server.  One can set a custom error callback to process server errors before the regular error processing routing. This allows handling showplan messages and print statement.  The following demonstrates how to handle showplan and print messages:  As of now the driver does not support bulk insert and named parameters. Password encryption only works for Sybase ASE > 15.5.  You can use stmt_test.go and session_test.go for sample usage, as follows:  Credits
Keywords: driver|sybase|tds