Skip to content

Instantly share code, notes, and snippets.

@bmorton
Last active August 29, 2015 14:26
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 bmorton/33e572b9d5b2655d1a9e to your computer and use it in GitHub Desktop.
Save bmorton/33e572b9d5b2655d1a9e to your computer and use it in GitHub Desktop.
{
"type": "record",
"name": "test",
"namespace": "com.martinkl.bottledwater.dbschema.public",
"fields": [
{
"name": "id",
"type": [
{
"type": "null"
},
{
"type": "int"
}
]
},
{
"name": "value",
"type": [
{
"type": "null"
},
{
"type": "string"
}
]
},
{
"name": "created_at",
"type": [
{
"type": "null"
},
{
"type": "record",
"name": "DateTime",
"namespace": "com.martinkl.bottledwater.datatypes",
"fields": [
{
"name": "year",
"type": {
"type": "int"
}
},
{
"name": "month",
"type": {
"type": "int"
}
},
{
"name": "day",
"type": {
"type": "int"
}
},
{
"name": "hour",
"type": {
"type": "int"
}
},
{
"name": "minute",
"type": {
"type": "int"
}
},
{
"name": "second",
"type": {
"type": "int"
}
},
{
"name": "micro",
"type": {
"type": "int"
}
}
]
},
{
"type": "enum",
"name": "SpecialTime",
"symbols": [
"POS_INFINITY",
"NEG_INFINITY"
]
}
]
},
{
"name": "updated_at",
"type": [
{
"type": "null"
},
{
"type": "record",
"name": "DateTime",
"namespace": "com.martinkl.bottledwater.datatypes",
"fields": [
{
"name": "year",
"type": {
"type": "int"
}
},
{
"name": "month",
"type": {
"type": "int"
}
},
{
"name": "day",
"type": {
"type": "int"
}
},
{
"name": "hour",
"type": {
"type": "int"
}
},
{
"name": "minute",
"type": {
"type": "int"
}
},
{
"name": "second",
"type": {
"type": "int"
}
},
{
"name": "micro",
"type": {
"type": "int"
}
}
]
},
{
"type": "enum",
"name": "SpecialTime",
"symbols": [
"POS_INFINITY",
"NEG_INFINITY"
]
}
]
}
]
}
create extension bottledwater;
create table test (
id serial primary key,
value text,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
insert into test (value, created_at, updated_at) values('hello world!', NOW(), NOW());
{
"type": "record",
"name": "test",
"namespace": "com.martinkl.bottledwater.dbschema.public",
"fields": [
{
"name": "id",
"type": [
{
"type": "null"
},
{
"type": "int"
}
]
},
{
"name": "value",
"type": [
{
"type": "null"
},
{
"type": "string"
}
]
},
{
"name": "created_at",
"type": [
{
"type": "null"
},
{
"type": "record",
"name": "DateTime",
"namespace": "com.martinkl.bottledwater.datatypes",
"fields": [
{
"name": "year",
"type": {
"type": "int"
}
},
{
"name": "month",
"type": {
"type": "int"
}
},
{
"name": "day",
"type": {
"type": "int"
}
},
{
"name": "hour",
"type": {
"type": "int"
}
},
{
"name": "minute",
"type": {
"type": "int"
}
},
{
"name": "second",
"type": {
"type": "int"
}
},
{
"name": "micro",
"type": {
"type": "int"
}
}
]
},
{
"type": "enum",
"name": "SpecialTime",
"symbols": [
"POS_INFINITY",
"NEG_INFINITY"
]
}
]
},
{
"name": "updated_at",
"type": [
{
"type": "null"
},
{
"type": "com.martinkl.bottledwater.datatypes.DateTime"
},
{
"type": "SpecialTime"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment