- Go implementation of MS SQL Server uniqueidentifier type.
- Implements the JSON Marshal/Unmarshal and SQL Scan interfaces to ensure that data is read correctly from DB.
- The uniqueidentifier data type is a 16-byte GUID*.
- This data type is used as primary key alternative to identity columns.
- uniqueidentifier is globally unique, whereas identity is unique within a table.
- Can be used alongside ORM such as GORM
package main
import uuid "github.com/tentone/mssql-uuid"
func main() {
var uid uuid.UUID = uuid.NewV4()
print(uid.String())
}
- Microsoft implementation of UUID uses litle endian for the first half the first 8 bytes, and big Endian encoding for the second 8 bytes.
- Because of this other UUID libs fail to correctly parse the data.
LLLLLLLL-LLLL-LLLL-BBBB-BBBBBBBBBBBB
- The project is distributed under MIT license.
- The lincese is available on the repository.