Coder Social home page Coder Social logo

mssql-uuid's Introduction

mssql-uuid

  • 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

Example

package main

import uuid "github.com/tentone/mssql-uuid"

func main() {
	var uid uuid.UUID = uuid.NewV4()
	print(uid.String())
}

UUID Storage

  • 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

License

  • The project is distributed under MIT license.
  • The lincese is available on the repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.