Documentation ¶
Index ¶
- Constants
- func GetProjectPath(id string) string
- func LoadProjectFile(projPath string) (v models.ProjectFile, err error)
- func NewSingleProjectLoader(path string) (loader storage.ProjectStore, projectID string)
- func NewStore(id string, pathsByID map[string]string) (fsStore storage.Store, err error)
- func SetProjectPath(id, path string)
- type DbCatalogFile
- type DbModelFile
- type Decoder
- type FsStore
- func (store FsStore) CreateProject(_ context.Context, _ dto.CreateProjectRequest) (*models.ProjectSummary, error)
- func (store FsStore) DeleteProject(_ context.Context, id string) error
- func (loader FsStore) GetFolderPath(projectID string, folder ...string) (folderPath string, err error)
- func (loader FsStore) GetProjectPath(projectID string) (projID string, projPath string, err error)
- func (store FsStore) GetProjectStore(id string) storage.ProjectStore
- func (store FsStore) GetProjects(context.Context) (projectBriefs []models.ProjectBrief, err error)
- func (loader FsStore) LoadRecordsetData(projectID, datasetName, fileName string) (*models.Recordset, error)
- func (loader FsStore) LoadRecordsetDefinition(projectID, recordsetID string) (dataset *models.RecordsetDefinition, err error)
- func (loader FsStore) LoadRecordsetDefinitions(projectID string) (recordsetDefs []*models.RecordsetDefinition, err error)
- type ProjDbServerFile
- type TableColumnsFile
- type TableFile
- type TableForeignKeysFile
- type TableModelColumnsFile
- type TableModelFile
- type TablePrimaryKeyFile
- type TablePropsFile
- type TableRefsByFile
Constants ¶
const ( BoardsFolder = "boards" ProjectSummaryFileName = "datatug-project.json" DataFolder = "data" DatatugFolder = "datatug" DbFolder = "db" DbCatalogsFolder = "catalogs" DbModelsFolder = "dbmodels" EntitiesFolder = "entities" EnvironmentsFolder = "environments" QueriesFolder = "queries" RecordsetsFolder = "recordsets" ServersFolder = "servers" SchemasFolder = "schemas" TablesFolder = "tables" ViewsFolder = "views" )
DatatugFolder defines a folder name in a repo where to storage DataTug project
Variables ¶
This section is empty.
Functions ¶
func LoadProjectFile ¶
func LoadProjectFile(projPath string) (v models.ProjectFile, err error)
LoadProjectFile loads project file
func NewSingleProjectLoader ¶
func NewSingleProjectLoader(path string) (loader storage.ProjectStore, projectID string)
NewSingleProjectLoader create new single project loader
Types ¶
type DbCatalogFile ¶
type DbCatalogFile struct { Driver string `json:"driver"` // It's excessive but good to have for validation Path string `json:"path,omitempty"` DbModel string `json:"dbmodel,omitempty"` }
DbCatalogFile defines metadata to be stored in a JSON file in the db folder
func (DbCatalogFile) Validate ¶
func (v DbCatalogFile) Validate() error
Validate returns error if not valid
type DbModelFile ¶
type DbModelFile struct { models.ProjectItem Environments models.DbModelEnvironments `json:"environments,omitempty"` }
DbModelFile defines what to storage to dbmodel file
func (DbModelFile) Validate ¶
func (v DbModelFile) Validate() error
Validate returns error if not valid
type FsStore ¶ added in v0.3.0
type FsStore struct {
// contains filtered or unexported fields
}
FsStore provides implementation of file system storage
func NewSingleProjectStore ¶
NewSingleProjectStore creates an instance of storage that implements storage.Store for a single project
func (FsStore) CreateProject ¶ added in v0.3.0
func (store FsStore) CreateProject(_ context.Context, _ dto.CreateProjectRequest) (*models.ProjectSummary, error)
func (FsStore) DeleteProject ¶ added in v0.3.0
func (FsStore) GetFolderPath ¶ added in v0.3.0
func (FsStore) GetProjectPath ¶ added in v0.3.0
GetProjectPath returns project projDirPath by project ID
func (FsStore) GetProjectStore ¶ added in v0.3.0
func (store FsStore) GetProjectStore(id string) storage.ProjectStore
func (FsStore) GetProjects ¶ added in v0.3.0
GetProjects returns list of projects
func (FsStore) LoadRecordsetData ¶ added in v0.3.0
func (loader FsStore) LoadRecordsetData(projectID, datasetName, fileName string) (*models.Recordset, error)
LoadRecordsetData loads recordset data
func (FsStore) LoadRecordsetDefinition ¶ added in v0.3.0
func (loader FsStore) LoadRecordsetDefinition(projectID, recordsetID string) (dataset *models.RecordsetDefinition, err error)
LoadRecordsetDefinition loads recordset definition
func (FsStore) LoadRecordsetDefinitions ¶ added in v0.3.0
func (loader FsStore) LoadRecordsetDefinitions(projectID string) (recordsetDefs []*models.RecordsetDefinition, err error)
LoadRecordsetDefinitions returns flat list of recordsets that might be stored in a tree structure directories
type ProjDbServerFile ¶
type ProjDbServerFile struct {
models.ProjectItem
}
ProjDbServerFile stores info about project DB server
type TableColumnsFile ¶
type TableColumnsFile struct { models.TableKey Columns []*models.TableColumn `json:"columns,omitempty"` }
TableColumnsFile info to be stored about column in a JSON file
type TableFile ¶
type TableFile struct { models.TableProps PrimaryKey *models.UniqueKey `json:"primaryKey,omitempty"` ForeignKeys []*models.ForeignKey `json:"foreignKeys,omitempty"` ReferencedBy []*models.TableReferencedBy `json:"referencedBy,omitempty"` Columns []*models.TableColumn `json:"columns,omitempty"` Indexes []*models.Index `json:"indexes,omitempty"` }
TableFile hold summary on table or view
type TableForeignKeysFile ¶
type TableForeignKeysFile struct { models.TableKey ForeignKeys []*models.ForeignKey `json:"foreignKeys"` }
TableForeignKeysFile info to be stored about FK in a JSON file
type TableModelColumnsFile ¶
type TableModelColumnsFile struct {
Columns models.ColumnModels `json:"columns,omitempty"`
}
TableModelColumnsFile info to be stored about column in a JSON file
func (TableModelColumnsFile) Validate ¶
func (v TableModelColumnsFile) Validate() error
Validate returns error if not valid
type TableModelFile ¶
TableModelFile defines what to storage in table model file
type TablePrimaryKeyFile ¶
type TablePrimaryKeyFile struct { models.TableKey PrimaryKey *models.UniqueKey `json:"primaryKey"` }
TablePrimaryKeyFile info to be stored about PK in a JSON file
type TablePropsFile ¶
type TablePropsFile struct { models.TableKey models.TableProps }
TablePropsFile info to be stored about table in a JSON file
type TableRefsByFile ¶
type TableRefsByFile struct { models.TableKey ReferencedBy []*models.TableReferencedBy `json:"referencedBy"` }
TableRefsByFile info to be stored about reference in a JSON file
Source Files ¶
- constants.go
- loader_env_servers.go
- loader_internals.go
- loader_recordsets.go
- models.go
- projects.go
- readme.go
- saver_filesystem.go
- saver_readme.go
- saver_update_proj_file.go
- store.go
- store_boards.go
- store_dbcatalog.go
- store_dbcatalogs.go
- store_dbmodels.go
- store_dbschema_saver.go
- store_dbserver.go
- store_dbservers.go
- store_entities.go
- store_entity.go
- store_entity_saver.go
- store_env_catalog.go
- store_env_catalogs.go
- store_env_server.go
- store_env_servers.go
- store_environment.go
- store_environments.go
- store_folders.go
- store_loader.go
- store_project.go
- store_project_saver.go
- store_queries.go
- store_queries_saver.go
- updater.go
- utils.go