datschema

package
v1.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(s *Schema) (model.Models, enum.Enums, error)

Types

type Column

type Column struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Array       bool   `json:"array,omitempty"`
	Type        string `json:"type"`
	Unique      bool   `json:"unique,omitempty"`
	Localized   bool   `json:"localized,omitempty"`
	References  any    `json:"references,omitempty"`
	Until       any    `json:"until,omitempty"`
	File        any    `json:"file,omitempty"`
	Files       any    `json:"files,omitempty"`
}

func (*Column) SafeName

func (c *Column) SafeName() string

type Columns

type Columns []*Column

type Enumeration

type Enumeration struct {
	Name        string   `json:"name"`
	Indexing    int      `json:"indexing"`
	Enumerators []string `json:"enumerators,omitempty"`
}

type Enumerations

type Enumerations []*Enumeration

type Schema

type Schema struct {
	Version      int          `json:"version"`
	CreatedAt    int          `json:"createdAt"`
	Tables       Tables       `json:"tables,omitempty"`
	Enumerations Enumerations `json:"enumerations,omitempty"`
}

type Table

type Table struct {
	Name    string   `json:"name"`
	Columns Columns  `json:"columns"`
	Tags    []string `json:"tags,omitempty"`
}

type Tables

type Tables []*Table

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL