func (m *ModelProvider) Schema(name string, tables ...string) (*Schema, error) {
	schema, err := m.Provider.Schema(name, tables...)
	if err != nil {
		return nil, err
	}
	schema.Model = SchemaModel{
		Package:          m.Config.Package,
		HasDocumentation: m.Config.InlcudeDoc,
	}
	for index, table := range schema.Tables {
		table.Name = m.tableName(schema, &table)
		table.Model = TableModel{
			HasDocumentation: m.Config.InlcudeDoc,
			Type:             m.typeName(&table),
			Package:          schema.Model.Package,
			PrimaryKey:       make(map[string]string),
		}
		for index, column := range table.Columns {
			column.Model = ColumnModel{
				HasDocumentation: m.Config.InlcudeDoc,
				Name:             m.fieldName(&column),
				Type:             m.fieldType(&column),
				Tag:              m.TagBuilder.Build(&column),
			}
			table.Columns[index] = column
		}
		m.setPrimaryKey(schema, &table)
		m.setSelectAllRoutine(schema, &table)
		m.setSelectByPKRoutine(schema, &table)
		m.setInsertRoutine(schema, &table)
		m.setDeleteByPKRoutine(schema, &table)
		m.setUpdateByPKRoutine(schema, &table)
		schema.Tables[index] = table
	}
	return schema, nil
}
Schema returns the schema definition
package sqlmodel
import (
	"bytes"
	"fmt"
	"regexp"
	"strconv"
	"strings"
	"github.com/go-openapi/inflect"
)
var (
	_ SchemaProvider = &ModelProvider{}
	_ SchemaProvider = &PostgreSQLProvider{}
	_ SchemaProvider = &MySQLProvider{}
	_ SchemaProvider = &SQLiteProvider{}
)
type ModelProviderConfig struct {
	Package string
	UseNamedParams bool
	InlcudeDoc bool
}
type ModelProvider struct {
	Config *ModelProviderConfig
	Provider SchemaProvider
	TagBuilder TagBuilder
}
func (m *ModelProvider) Tables(schema string) ([]string, error) {
	return m.Provider.Tables(schema)
}