Cleaned up old store (record, rvalues) code, add missing tests
This commit is contained in:
@@ -15,7 +15,6 @@ component: schema.#component & {
|
||||
"namespace": namespace
|
||||
"page": page
|
||||
"record": record
|
||||
"record-value": recordValue
|
||||
}
|
||||
|
||||
rbac: operations: {
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
package compose
|
||||
|
||||
import (
|
||||
"github.com/cortezaproject/corteza-server/codegen/schema"
|
||||
)
|
||||
|
||||
recordValue: schema.#Resource & {
|
||||
struct: {
|
||||
record_id: { primaryKey: true, goType: "uint64", ident: "recordID" }
|
||||
name: { primaryKey: true, }
|
||||
place: { primaryKey: true, goType: "uint" }
|
||||
ref: { goType: "uint64" }
|
||||
value: { }
|
||||
deleted_at: schema.SortableTimestampNilField
|
||||
}
|
||||
|
||||
features: {
|
||||
labels: false
|
||||
paging: false
|
||||
sorting: false
|
||||
checkFn: false
|
||||
}
|
||||
|
||||
filter: {
|
||||
struct: {
|
||||
record_id: { goType: "[]uint64", ident: "recordID" }
|
||||
deleted: { goType: "filter.State", storeIdent: "deleted_at" }
|
||||
}
|
||||
|
||||
byValue: ["record_id"]
|
||||
byNilState: ["deleted"]
|
||||
}
|
||||
|
||||
|
||||
store: {
|
||||
ident: "composeRecordValue"
|
||||
|
||||
settings: {
|
||||
rdbms: {
|
||||
table: "compose_record_value"
|
||||
}
|
||||
}
|
||||
|
||||
api: {
|
||||
|
||||
|
||||
functions: [
|
||||
{
|
||||
expIdent: "ComposeRecordValueRefLookup"
|
||||
args: [
|
||||
{ ident: "mod", goType: "*types.Module" },
|
||||
{ ident: "field", goType: "string" },
|
||||
{ ident: "ref", goType: "uint64" }
|
||||
]
|
||||
return: [ "uint64" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,7 +181,8 @@ func defaultValidator(svc RecordService) recordValuesValidator {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
return store.ComposeRecordValueRefLookup(ctx, s, m, f.Name, v.Ref)
|
||||
// @todo re-implement record-value ref lookup through DAL
|
||||
panic("implement me")
|
||||
})
|
||||
|
||||
validator.RecordRefChecker(func(ctx context.Context, s store.Storer, v *types.RecordValue, f *types.ModuleField, m *types.Module) (bool, error) {
|
||||
|
||||
@@ -31,7 +31,6 @@ type (
|
||||
store.ComposeModules
|
||||
store.ComposeNamespaces
|
||||
store.ComposePages
|
||||
store.ComposeRecordValues
|
||||
}
|
||||
|
||||
dalService interface {
|
||||
|
||||
Generated
-51
@@ -308,16 +308,6 @@ type (
|
||||
DeletedAt *time.Time `db:"deleted_at"`
|
||||
}
|
||||
|
||||
// auxComposeRecordValue is an auxiliary structure used for transporting to/from RDBMS store
|
||||
auxComposeRecordValue struct {
|
||||
RecordID uint64 `db:"record_id"`
|
||||
Name string `db:"name"`
|
||||
Place uint `db:"place"`
|
||||
Ref uint64 `db:"ref"`
|
||||
Value string `db:"value"`
|
||||
DeletedAt *time.Time `db:"deleted_at"`
|
||||
}
|
||||
|
||||
// auxCredential is an auxiliary structure used for transporting to/from RDBMS store
|
||||
auxCredential struct {
|
||||
ID uint64 `db:"id"`
|
||||
@@ -1687,47 +1677,6 @@ func (aux *auxComposePage) scan(row scanner) error {
|
||||
)
|
||||
}
|
||||
|
||||
// encodes ComposeRecordValue to auxComposeRecordValue
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (aux *auxComposeRecordValue) encode(res *composeType.RecordValue) (_ error) {
|
||||
aux.RecordID = res.RecordID
|
||||
aux.Name = res.Name
|
||||
aux.Place = res.Place
|
||||
aux.Ref = res.Ref
|
||||
aux.Value = res.Value
|
||||
aux.DeletedAt = res.DeletedAt
|
||||
return
|
||||
}
|
||||
|
||||
// decodes ComposeRecordValue from auxComposeRecordValue
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (aux auxComposeRecordValue) decode() (res *composeType.RecordValue, _ error) {
|
||||
res = new(composeType.RecordValue)
|
||||
res.RecordID = aux.RecordID
|
||||
res.Name = aux.Name
|
||||
res.Place = aux.Place
|
||||
res.Ref = aux.Ref
|
||||
res.Value = aux.Value
|
||||
res.DeletedAt = aux.DeletedAt
|
||||
return
|
||||
}
|
||||
|
||||
// scans row and fills auxComposeRecordValue fields
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (aux *auxComposeRecordValue) scan(row scanner) error {
|
||||
return row.Scan(
|
||||
&aux.RecordID,
|
||||
&aux.Name,
|
||||
&aux.Place,
|
||||
&aux.Ref,
|
||||
&aux.Value,
|
||||
&aux.DeletedAt,
|
||||
)
|
||||
}
|
||||
|
||||
// encodes Credential to auxCredential
|
||||
//
|
||||
// This function is auto-generated
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
package rdbms
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
composeType "github.com/cortezaproject/corteza-server/compose/types"
|
||||
"github.com/cortezaproject/corteza-server/pkg/report"
|
||||
)
|
||||
|
||||
func (s Store) ComposeRecordReport(ctx context.Context, mod *composeType.Module, metrics string, dimensions string, filters string) ([]map[string]interface{}, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (s Store) ComposeRecordDatasource(ctx context.Context, mod *composeType.Module, ld *report.LoadStepDefinition) (report.Datasource, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (s Store) PartialComposeRecordValueUpdate(ctx context.Context, mod *composeType.Module, values ...*composeType.RecordValue) error {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (s Store) ComposeRecordValueRefLookup(ctx context.Context, m *composeType.Module, field string, ref uint64) (uint64, error) {
|
||||
//q := s.composeRecordValuesSelectBuilder().
|
||||
// Join(s.composeRecordTable("crd"), "crv.record_id = crd.id").
|
||||
// Where(squirrel.Eq{
|
||||
// "crv.name": field,
|
||||
// "crv.ref": ref,
|
||||
// "crv.deleted_at": nil,
|
||||
// "crd.module_id": m.ID,
|
||||
// "crd.deleted_at": nil,
|
||||
// }).
|
||||
// Column("record_id").
|
||||
// Limit(1)
|
||||
//
|
||||
//row, err := s.QueryRow(ctx, q)
|
||||
//if errors.Is(err, sql.ErrNoRows) {
|
||||
// return 0, nil
|
||||
//} else if err != nil {
|
||||
// return 0, err
|
||||
//}
|
||||
//
|
||||
//var recordID uint64
|
||||
//if err = row.Scan(&recordID); err != nil {
|
||||
// return 0, err
|
||||
//}
|
||||
//
|
||||
//return recordID, nil
|
||||
return 0, nil
|
||||
}
|
||||
Generated
-23
@@ -83,9 +83,6 @@ type (
|
||||
// optional composePage filter function called after the generated function
|
||||
ComposePage func(*Store, composeType.PageFilter) ([]goqu.Expression, composeType.PageFilter, error)
|
||||
|
||||
// optional composeRecordValue filter function called after the generated function
|
||||
ComposeRecordValue func(*Store, composeType.RecordValueFilter) ([]goqu.Expression, composeType.RecordValueFilter, error)
|
||||
|
||||
// optional credential filter function called after the generated function
|
||||
Credential func(*Store, systemType.CredentialFilter) ([]goqu.Expression, systemType.CredentialFilter, error)
|
||||
|
||||
@@ -658,26 +655,6 @@ func ComposePageFilter(f composeType.PageFilter) (ee []goqu.Expression, _ compos
|
||||
return ee, f, err
|
||||
}
|
||||
|
||||
// ComposeRecordValueFilter returns logical expressions
|
||||
//
|
||||
// This function is called from Store.QueryComposeRecordValues() and can be extended
|
||||
// by setting Store.Filters.ComposeRecordValue. Extension is called after all expressions
|
||||
// are generated and can choose to ignore or alter them.
|
||||
//
|
||||
// This function is auto-generated
|
||||
func ComposeRecordValueFilter(f composeType.RecordValueFilter) (ee []goqu.Expression, _ composeType.RecordValueFilter, err error) {
|
||||
|
||||
if expr := stateNilComparison("deleted_at", f.Deleted); expr != nil {
|
||||
ee = append(ee, expr)
|
||||
}
|
||||
|
||||
if len(f.RecordID) > 0 {
|
||||
ee = append(ee, goqu.C("record_id").In(f.RecordID))
|
||||
}
|
||||
|
||||
return ee, f, err
|
||||
}
|
||||
|
||||
// CredentialFilter returns logical expressions
|
||||
//
|
||||
// This function is called from Store.QueryCredentials() and can be extended
|
||||
|
||||
Generated
-90
@@ -2095,96 +2095,6 @@ var (
|
||||
}
|
||||
}
|
||||
|
||||
// composeRecordValueTable represents composeRecordValues store table
|
||||
//
|
||||
// This value is auto-generated
|
||||
composeRecordValueTable = goqu.T("compose_record_value")
|
||||
|
||||
// composeRecordValueSelectQuery assembles select query for fetching composeRecordValues
|
||||
//
|
||||
// This function is auto-generated
|
||||
composeRecordValueSelectQuery = func(d goqu.DialectWrapper) *goqu.SelectDataset {
|
||||
return d.Select(
|
||||
"record_id",
|
||||
"name",
|
||||
"place",
|
||||
"ref",
|
||||
"value",
|
||||
"deleted_at",
|
||||
).From(composeRecordValueTable)
|
||||
}
|
||||
|
||||
// composeRecordValueInsertQuery assembles query inserting composeRecordValues
|
||||
//
|
||||
// This function is auto-generated
|
||||
composeRecordValueInsertQuery = func(d goqu.DialectWrapper, res *composeType.RecordValue) *goqu.InsertDataset {
|
||||
return d.Insert(composeRecordValueTable).
|
||||
Rows(goqu.Record{
|
||||
"record_id": res.RecordID,
|
||||
"name": res.Name,
|
||||
"place": res.Place,
|
||||
"ref": res.Ref,
|
||||
"value": res.Value,
|
||||
"deleted_at": res.DeletedAt,
|
||||
})
|
||||
}
|
||||
|
||||
// composeRecordValueUpsertQuery assembles (insert+on-conflict) query for replacing composeRecordValues
|
||||
//
|
||||
// This function is auto-generated
|
||||
composeRecordValueUpsertQuery = func(d goqu.DialectWrapper, res *composeType.RecordValue) *goqu.InsertDataset {
|
||||
var target = `,record_id,name,place`
|
||||
|
||||
return composeRecordValueInsertQuery(d, res).
|
||||
OnConflict(
|
||||
goqu.DoUpdate(target[1:],
|
||||
goqu.Record{
|
||||
"ref": res.Ref,
|
||||
"value": res.Value,
|
||||
"deleted_at": res.DeletedAt,
|
||||
},
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
// composeRecordValueUpdateQuery assembles query for updating composeRecordValues
|
||||
//
|
||||
// This function is auto-generated
|
||||
composeRecordValueUpdateQuery = func(d goqu.DialectWrapper, res *composeType.RecordValue) *goqu.UpdateDataset {
|
||||
return d.Update(composeRecordValueTable).
|
||||
Set(goqu.Record{
|
||||
"ref": res.Ref,
|
||||
"value": res.Value,
|
||||
"deleted_at": res.DeletedAt,
|
||||
}).
|
||||
Where(composeRecordValuePrimaryKeys(res))
|
||||
}
|
||||
|
||||
// composeRecordValueDeleteQuery assembles delete query for removing composeRecordValues
|
||||
//
|
||||
// This function is auto-generated
|
||||
composeRecordValueDeleteQuery = func(d goqu.DialectWrapper, ee ...goqu.Expression) *goqu.DeleteDataset {
|
||||
return d.Delete(composeRecordValueTable).Where(ee...)
|
||||
}
|
||||
|
||||
// composeRecordValueDeleteQuery assembles delete query for removing composeRecordValues
|
||||
//
|
||||
// This function is auto-generated
|
||||
composeRecordValueTruncateQuery = func(d goqu.DialectWrapper) *goqu.TruncateDataset {
|
||||
return d.Truncate(composeRecordValueTable)
|
||||
}
|
||||
|
||||
// composeRecordValuePrimaryKeys assembles set of conditions for all primary keys
|
||||
//
|
||||
// This function is auto-generated
|
||||
composeRecordValuePrimaryKeys = func(res *composeType.RecordValue) goqu.Ex {
|
||||
return goqu.Ex{
|
||||
"record_id": res.RecordID,
|
||||
"name": res.Name,
|
||||
"place": res.Place,
|
||||
}
|
||||
}
|
||||
|
||||
// credentialTable represents credentials store table
|
||||
//
|
||||
// This value is auto-generated
|
||||
|
||||
Generated
-260
@@ -47,7 +47,6 @@ var (
|
||||
_ store.ComposeModuleFields = &Store{}
|
||||
_ store.ComposeNamespaces = &Store{}
|
||||
_ store.ComposePages = &Store{}
|
||||
_ store.ComposeRecordValues = &Store{}
|
||||
_ store.Credentials = &Store{}
|
||||
_ store.DalConnections = &Store{}
|
||||
_ store.DalSensitivityLevels = &Store{}
|
||||
@@ -8529,265 +8528,6 @@ func (s *Store) checkComposePageConstraints(ctx context.Context, res *composeTyp
|
||||
return nil
|
||||
}
|
||||
|
||||
// CreateComposeRecordValue creates one or more rows in composeRecordValue collection
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (s *Store) CreateComposeRecordValue(ctx context.Context, rr ...*composeType.RecordValue) (err error) {
|
||||
for i := range rr {
|
||||
if err = s.checkComposeRecordValueConstraints(ctx, rr[i]); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = s.Exec(ctx, composeRecordValueInsertQuery(s.Dialect, rr[i])); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateComposeRecordValue updates one or more existing entries in composeRecordValue collection
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (s *Store) UpdateComposeRecordValue(ctx context.Context, rr ...*composeType.RecordValue) (err error) {
|
||||
for i := range rr {
|
||||
if err = s.checkComposeRecordValueConstraints(ctx, rr[i]); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = s.Exec(ctx, composeRecordValueUpdateQuery(s.Dialect, rr[i])); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpsertComposeRecordValue updates one or more existing entries in composeRecordValue collection
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (s *Store) UpsertComposeRecordValue(ctx context.Context, rr ...*composeType.RecordValue) (err error) {
|
||||
for i := range rr {
|
||||
if err = s.checkComposeRecordValueConstraints(ctx, rr[i]); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = s.Exec(ctx, composeRecordValueUpsertQuery(s.Dialect, rr[i])); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteComposeRecordValue Deletes one or more entries from composeRecordValue collection
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (s *Store) DeleteComposeRecordValue(ctx context.Context, rr ...*composeType.RecordValue) (err error) {
|
||||
for i := range rr {
|
||||
if err = s.Exec(ctx, composeRecordValueDeleteQuery(s.Dialect, composeRecordValuePrimaryKeys(rr[i]))); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeleteComposeRecordValueByID deletes single entry from composeRecordValue collection
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (s *Store) DeleteComposeRecordValueByRecordIDNamePlace(ctx context.Context, recordID uint64, name string, place uint) error {
|
||||
return s.Exec(ctx, composeRecordValueDeleteQuery(s.Dialect, goqu.Ex{
|
||||
"record_id": recordID,
|
||||
"name": name,
|
||||
"place": place,
|
||||
}))
|
||||
}
|
||||
|
||||
// TruncateComposeRecordValues Deletes all rows from the composeRecordValue collection
|
||||
func (s Store) TruncateComposeRecordValues(ctx context.Context) error {
|
||||
return s.Exec(ctx, composeRecordValueTruncateQuery(s.Dialect))
|
||||
}
|
||||
|
||||
// SearchComposeRecordValues returns (filtered) set of ComposeRecordValues
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (s *Store) SearchComposeRecordValues(ctx context.Context, f composeType.RecordValueFilter) (set composeType.RecordValueSet, _ composeType.RecordValueFilter, err error) {
|
||||
|
||||
set, _, err = s.QueryComposeRecordValues(ctx, f)
|
||||
if err != nil {
|
||||
return nil, f, err
|
||||
}
|
||||
|
||||
return set, f, nil
|
||||
}
|
||||
|
||||
// QueryComposeRecordValues queries the database, converts and checks each row and returns collected set
|
||||
//
|
||||
// With generics, we can remove this per-resource-generated function
|
||||
// and replace it with a single utility fetcher
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (s *Store) QueryComposeRecordValues(
|
||||
ctx context.Context,
|
||||
f composeType.RecordValueFilter,
|
||||
) (_ []*composeType.RecordValue, more bool, err error) {
|
||||
var (
|
||||
set = make([]*composeType.RecordValue, 0, DefaultSliceCapacity)
|
||||
res *composeType.RecordValue
|
||||
aux *auxComposeRecordValue
|
||||
rows *sql.Rows
|
||||
count uint
|
||||
expr, tExpr []goqu.Expression
|
||||
)
|
||||
|
||||
if s.Filters.ComposeRecordValue != nil {
|
||||
// extended filter set
|
||||
tExpr, f, err = s.Filters.ComposeRecordValue(s, f)
|
||||
} else {
|
||||
// using generated filter
|
||||
tExpr, f, err = ComposeRecordValueFilter(f)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
err = fmt.Errorf("could generate filter expression for ComposeRecordValue: %w", err)
|
||||
return
|
||||
}
|
||||
|
||||
expr = append(expr, tExpr...)
|
||||
|
||||
query := composeRecordValueSelectQuery(s.Dialect).Where(expr...)
|
||||
|
||||
if f.Limit > 0 {
|
||||
query = query.Limit(f.Limit)
|
||||
}
|
||||
|
||||
rows, err = s.Query(ctx, query)
|
||||
if err != nil {
|
||||
err = fmt.Errorf("could not query ComposeRecordValue: %w", err)
|
||||
return
|
||||
}
|
||||
|
||||
if err = rows.Err(); err != nil {
|
||||
err = fmt.Errorf("could not query ComposeRecordValue: %w", err)
|
||||
return
|
||||
}
|
||||
|
||||
defer func() {
|
||||
closeError := rows.Close()
|
||||
if err == nil {
|
||||
// return error from close
|
||||
err = closeError
|
||||
}
|
||||
}()
|
||||
|
||||
for rows.Next() {
|
||||
if err = rows.Err(); err != nil {
|
||||
err = fmt.Errorf("could not query ComposeRecordValue: %w", err)
|
||||
return
|
||||
}
|
||||
|
||||
aux = new(auxComposeRecordValue)
|
||||
if err = aux.scan(rows); err != nil {
|
||||
err = fmt.Errorf("could not scan rows for ComposeRecordValue: %w", err)
|
||||
return
|
||||
}
|
||||
|
||||
count++
|
||||
if res, err = aux.decode(); err != nil {
|
||||
err = fmt.Errorf("could not decode ComposeRecordValue: %w", err)
|
||||
return
|
||||
}
|
||||
|
||||
set = append(set, res)
|
||||
}
|
||||
|
||||
return set, false, err
|
||||
|
||||
}
|
||||
|
||||
// sortableComposeRecordValueFields returns all <no value> columns flagged as sortable
|
||||
//
|
||||
// With optional string arg, all columns are returned aliased
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (Store) sortableComposeRecordValueFields() map[string]string {
|
||||
return map[string]string{
|
||||
"deleted_at": "deleted_at",
|
||||
"deletedat": "deleted_at",
|
||||
"name": "name",
|
||||
"place": "place",
|
||||
"record_id": "record_id",
|
||||
"recordid": "record_id",
|
||||
}
|
||||
}
|
||||
|
||||
// collectComposeRecordValueCursorValues collects values from the given resource that and sets them to the cursor
|
||||
// to be used for pagination
|
||||
//
|
||||
// Values that are collected must come from sortable, unique or primary columns/fields
|
||||
// At least one of the collected columns must be flagged as unique, otherwise fn appends primary keys at the end
|
||||
//
|
||||
// Known issue:
|
||||
// when collecting cursor values for query that sorts by unique column with partial index (ie: unique handle on
|
||||
// undeleted items)
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (s *Store) collectComposeRecordValueCursorValues(res *composeType.RecordValue, cc ...*filter.SortExpr) *filter.PagingCursor {
|
||||
var (
|
||||
cur = &filter.PagingCursor{LThen: filter.SortExprSet(cc).Reversed()}
|
||||
|
||||
hasUnique bool
|
||||
|
||||
pkRecordID bool
|
||||
pkName bool
|
||||
pkPlace bool
|
||||
|
||||
collect = func(cc ...*filter.SortExpr) {
|
||||
for _, c := range cc {
|
||||
switch c.Column {
|
||||
case "recordID":
|
||||
cur.Set(c.Column, res.RecordID, c.Descending)
|
||||
pkRecordID = true
|
||||
case "name":
|
||||
cur.Set(c.Column, res.Name, c.Descending)
|
||||
pkName = true
|
||||
case "place":
|
||||
cur.Set(c.Column, res.Place, c.Descending)
|
||||
pkPlace = true
|
||||
case "deletedAt":
|
||||
cur.Set(c.Column, res.DeletedAt, c.Descending)
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
collect(cc...)
|
||||
if !hasUnique || !pkRecordID {
|
||||
collect(&filter.SortExpr{Column: "recordID", Descending: false})
|
||||
}
|
||||
if !hasUnique || !pkName {
|
||||
collect(&filter.SortExpr{Column: "name", Descending: false})
|
||||
}
|
||||
if !hasUnique || !pkPlace {
|
||||
collect(&filter.SortExpr{Column: "place", Descending: false})
|
||||
}
|
||||
|
||||
return cur
|
||||
|
||||
}
|
||||
|
||||
// checkComposeRecordValueConstraints performs lookups (on valid) resource to check if any of the values on unique fields
|
||||
// already exists in the store
|
||||
//
|
||||
// Using built-in constraint checking would be more performant, but unfortunately we cannot rely
|
||||
// on the full support (MySQL does not support conditional indexes)
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (s *Store) checkComposeRecordValueConstraints(ctx context.Context, res *composeType.RecordValue) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// CreateCredential creates one or more rows in credential collection
|
||||
//
|
||||
// This function is auto-generated
|
||||
|
||||
Generated
-68
@@ -56,7 +56,6 @@ type (
|
||||
ComposeModuleFields
|
||||
ComposeNamespaces
|
||||
ComposePages
|
||||
ComposeRecordValues
|
||||
Credentials
|
||||
DalConnections
|
||||
DalSensitivityLevels
|
||||
@@ -304,17 +303,6 @@ type (
|
||||
ReorderComposePages(ctx context.Context, namespace_id uint64, parent_id uint64, page_ids []uint64) error
|
||||
}
|
||||
|
||||
ComposeRecordValues interface {
|
||||
SearchComposeRecordValues(ctx context.Context, f composeType.RecordValueFilter) (composeType.RecordValueSet, composeType.RecordValueFilter, error)
|
||||
CreateComposeRecordValue(ctx context.Context, rr ...*composeType.RecordValue) error
|
||||
UpdateComposeRecordValue(ctx context.Context, rr ...*composeType.RecordValue) error
|
||||
UpsertComposeRecordValue(ctx context.Context, rr ...*composeType.RecordValue) error
|
||||
DeleteComposeRecordValue(ctx context.Context, rr ...*composeType.RecordValue) error
|
||||
DeleteComposeRecordValueByRecordIDNamePlace(ctx context.Context, recordID uint64, name string, place uint) error
|
||||
TruncateComposeRecordValues(ctx context.Context) error
|
||||
ComposeRecordValueRefLookup(ctx context.Context, mod *composeType.Module, field string, ref uint64) (uint64, error)
|
||||
}
|
||||
|
||||
Credentials interface {
|
||||
SearchCredentials(ctx context.Context, f systemType.CredentialFilter) (systemType.CredentialSet, systemType.CredentialFilter, error)
|
||||
CreateCredential(ctx context.Context, rr ...*systemType.Credential) error
|
||||
@@ -1790,62 +1778,6 @@ func ReorderComposePages(ctx context.Context, s ComposePages, namespace_id uint6
|
||||
return s.ReorderComposePages(ctx, namespace_id, parent_id, page_ids)
|
||||
}
|
||||
|
||||
// SearchComposeRecordValues returns all matching ComposeRecordValues from store
|
||||
//
|
||||
// This function is auto-generated
|
||||
func SearchComposeRecordValues(ctx context.Context, s ComposeRecordValues, f composeType.RecordValueFilter) (composeType.RecordValueSet, composeType.RecordValueFilter, error) {
|
||||
return s.SearchComposeRecordValues(ctx, f)
|
||||
}
|
||||
|
||||
// CreateComposeRecordValue creates one or more ComposeRecordValues in store
|
||||
//
|
||||
// This function is auto-generated
|
||||
func CreateComposeRecordValue(ctx context.Context, s ComposeRecordValues, rr ...*composeType.RecordValue) error {
|
||||
return s.CreateComposeRecordValue(ctx, rr...)
|
||||
}
|
||||
|
||||
// UpdateComposeRecordValue updates one or more (existing) ComposeRecordValues in store
|
||||
//
|
||||
// This function is auto-generated
|
||||
func UpdateComposeRecordValue(ctx context.Context, s ComposeRecordValues, rr ...*composeType.RecordValue) error {
|
||||
return s.UpdateComposeRecordValue(ctx, rr...)
|
||||
}
|
||||
|
||||
// UpsertComposeRecordValue creates new or updates existing one or more ComposeRecordValues in store
|
||||
//
|
||||
// This function is auto-generated
|
||||
func UpsertComposeRecordValue(ctx context.Context, s ComposeRecordValues, rr ...*composeType.RecordValue) error {
|
||||
return s.UpsertComposeRecordValue(ctx, rr...)
|
||||
}
|
||||
|
||||
// DeleteComposeRecordValue deletes one or more ComposeRecordValues from store
|
||||
//
|
||||
// This function is auto-generated
|
||||
func DeleteComposeRecordValue(ctx context.Context, s ComposeRecordValues, rr ...*composeType.RecordValue) error {
|
||||
return s.DeleteComposeRecordValue(ctx, rr...)
|
||||
}
|
||||
|
||||
// DeleteComposeRecordValueByID deletes one or more ComposeRecordValues from store
|
||||
//
|
||||
// This function is auto-generated
|
||||
func DeleteComposeRecordValueByRecordIDNamePlace(ctx context.Context, s ComposeRecordValues, recordID uint64, name string, place uint) error {
|
||||
return s.DeleteComposeRecordValueByRecordIDNamePlace(ctx, recordID, name, place)
|
||||
}
|
||||
|
||||
// TruncateComposeRecordValues Deletes all ComposeRecordValues from store
|
||||
//
|
||||
// This function is auto-generated
|
||||
func TruncateComposeRecordValues(ctx context.Context, s ComposeRecordValues) error {
|
||||
return s.TruncateComposeRecordValues(ctx)
|
||||
}
|
||||
|
||||
// ComposeRecordValueRefLookup
|
||||
//
|
||||
// This function is auto-generated
|
||||
func ComposeRecordValueRefLookup(ctx context.Context, s ComposeRecordValues, mod *composeType.Module, field string, ref uint64) (uint64, error) {
|
||||
return s.ComposeRecordValueRefLookup(ctx, mod, field, ref)
|
||||
}
|
||||
|
||||
// SearchCredentials returns all matching Credentials from store
|
||||
//
|
||||
// This function is auto-generated
|
||||
|
||||
@@ -68,9 +68,6 @@ func testAllGenerated(t *testing.T, s store.Storer) {
|
||||
t.Run("composePage", func(t *testing.T) {
|
||||
testComposePages(t, s)
|
||||
})
|
||||
t.Run("composeRecordValue", func(t *testing.T) {
|
||||
testComposeRecordValues(t, s)
|
||||
})
|
||||
t.Run("credential", func(t *testing.T) {
|
||||
testCredentials(t, s)
|
||||
})
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/cortezaproject/corteza-server/store"
|
||||
)
|
||||
|
||||
func testComposeRecordValues(t *testing.T, s store.ComposeRecordValues) {
|
||||
t.Run("RefLookup", func(t *testing.T) {
|
||||
t.Skip("not implemented")
|
||||
})
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,13 +0,0 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/cortezaproject/corteza-server/store"
|
||||
)
|
||||
|
||||
func testConnections(t *testing.T, s store.Connections) {
|
||||
t.Skip("temporary disabled")
|
||||
|
||||
// ...
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"github.com/cortezaproject/corteza-server/store"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func testDalConnections(t *testing.T, s store.DalConnections) {
|
||||
// @todo
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"github.com/cortezaproject/corteza-server/store"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func testDalSensitivityLevels(t *testing.T, s store.DalSensitivityLevels) {
|
||||
// @todo
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"github.com/cortezaproject/corteza-server/store"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func testDataPrivacyRequestComments(t *testing.T, s store.DataPrivacyRequestComments) {
|
||||
// @todo
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"github.com/cortezaproject/corteza-server/store"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func testDataPrivacyRequests(t *testing.T, s store.DataPrivacyRequests) {
|
||||
// @todo
|
||||
}
|
||||
Reference in New Issue
Block a user