(ctx context.Context, key string, v interface{})
| 111 | } |
| 112 | |
| 113 | func (d *sqliteModel) Read(ctx context.Context, key string, v interface{}) error { |
| 114 | schema, err := d.schema(v) |
| 115 | if err != nil { |
| 116 | return err |
| 117 | } |
| 118 | cols := columnList(schema) |
| 119 | query := fmt.Sprintf("SELECT %s FROM %q WHERE %q = ?", cols, schema.Table, schema.Key) |
| 120 | row := d.db.QueryRowContext(ctx, query, key) |
| 121 | fields, err := scanRow(schema, row) |
| 122 | if err != nil { |
| 123 | return err |
| 124 | } |
| 125 | model.MapToStruct(schema, fields, v) |
| 126 | return nil |
| 127 | } |
| 128 | |
| 129 | func (d *sqliteModel) Update(ctx context.Context, v interface{}) error { |
| 130 | schema, err := d.schema(v) |
nothing calls this directly
no test coverage detected