ReadSchemaString returns the schema definition for a specific tenant and version as a string.
(_ context.Context, tenantID, version string)
| 53 | |
| 54 | // ReadSchemaString returns the schema definition for a specific tenant and version as a string. |
| 55 | func (r *SchemaReader) ReadSchemaString(_ context.Context, tenantID, version string) (definitions []string, err error) { |
| 56 | txn := r.database.DB.Txn(false) |
| 57 | defer txn.Abort() |
| 58 | var it memdb.ResultIterator |
| 59 | it, err = txn.Get(constants.SchemaDefinitionsTable, "version", tenantID, version) |
| 60 | if err != nil { |
| 61 | return []string{}, errors.New(base.ErrorCode_ERROR_CODE_EXECUTION.String()) |
| 62 | } |
| 63 | |
| 64 | for obj := it.Next(); obj != nil; obj = it.Next() { |
| 65 | definitions = append(definitions, obj.(storage.SchemaDefinition).Serialized()) |
| 66 | } |
| 67 | |
| 68 | return definitions, nil |
| 69 | } |
| 70 | |
| 71 | // ReadEntityDefinition - Reads a Entity Definition from repository |
| 72 | func (r *SchemaReader) ReadEntityDefinition(_ context.Context, tenantID, entityName, version string) (definition *base.EntityDefinition, v string, err error) { |
nothing calls this directly
no test coverage detected