Skip to content

Instantly share code, notes, and snippets.

@vaijab
Created October 18, 2016 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vaijab/16199b7cc6ffa325f7464fc9515bac15 to your computer and use it in GitHub Desktop.
Save vaijab/16199b7cc6ffa325f7464fc9515bac15 to your computer and use it in GitHub Desktop.
type Foo struct {
Name string
Number interface{} // Optional field
}
// SQL
CREATE TABLE foo (
name VARCHAR(255),
number INTEGER // Sometimes it is actually NULL
)
type Foo struct {
Name string
Number int // Optional field
}
// SQL
CREATE TABLE foo (
name VARCHAR(255),
number INTEGER DEFAULT 0
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment