Create implements the Storage abstraction interface.
(nodeCnt int)
| 35 | |
| 36 | // Create implements the Storage abstraction interface. |
| 37 | func (s *CovenantSQLStorage) Create(nodeCnt int) (dbID string, err error) { |
| 38 | var meta = client.ResourceMeta{} |
| 39 | meta.Node = uint16(nodeCnt) |
| 40 | |
| 41 | var dsn string |
| 42 | if _, dsn, err = client.Create(meta); err != nil { |
| 43 | return |
| 44 | } |
| 45 | |
| 46 | var cfg *client.Config |
| 47 | if cfg, err = client.ParseDSN(dsn); err != nil { |
| 48 | return |
| 49 | } |
| 50 | |
| 51 | dbID = cfg.DatabaseID |
| 52 | return |
| 53 | } |
| 54 | |
| 55 | // Drop implements the Storage abstraction interface. |
| 56 | func (s *CovenantSQLStorage) Drop(dbID string) (err error) { |