Categorygithub.com/segmentio/go-tableize
modulepackage
2.1.0+incompatible
Repository: https://github.com/segmentio/go-tableize.git
Documentation: pkg.go.dev

# README

tablelize

Go tableize the given map by recursively walking the map and normalizing its keys to produce a flat SQL-friendly map.

CLI

$ go get github.com/segmentio/go-tableize/cmd/tableize
$ echo '{"user": { "id": 1 }}' | tableize
{ "user_id": 1 }

Example

event := map[string]interface{}{
  "name": map[string]interface{}{
    "first   name  ": "tobi",
    "last-name":      "holowaychuk",
  },
  "species": "ferret",
}

flat := Tableize(event)
assert(t, flat["name_first_name"] == "tobi")
assert(t, flat["name_last_name"] == "holowaychuk")
assert(t, flat["species"] == "ferret")

# Packages

No description provided by the author

# Functions

Tableize the given map by flattening and normalizing all of the key/value pairs recursively.

# Structs

Input contains all information to be tableized.