matthewmueller / pogo

Type-safe Database Client for Go. Supports PostgreSQL and SQLite.
MIT License
6 stars 0 forks source link

Add meta information about the table #38

Open matthewmueller opened 4 years ago

matthewmueller commented 4 years ago
// Table provides meta information about the "posts" table
var Table = sql.Table{
    Name: "posts",
    Columns: sql.Columns{
        {
            Order:   1,
            Name:    "id",
            Type:    "int",
            NotNull: true,
        },
        {
            Order:   2,
            Name:    "title",
            Type:    "text",
            NotNull: false,
        },
    },
    Primary: &sql.Primary{
        Name: "posts_pkey",
        Columns: sql.Columns{
            {
                Order:   1,
                Name:    "id",
                Type:    "int",
                NotNull: true,
            },
        },
    },
}