diff --git a/clients/go/db/db.go b/clients/go/db/db.go index 6ba0a5f..9f3881f 100755 --- a/clients/go/db/db.go +++ b/clients/go/db/db.go @@ -34,12 +34,24 @@ func (t *DbService) Delete(request *DeleteRequest) (*DeleteResponse, error) { return rsp, t.client.Call("db", "Delete", request, rsp) } +// +func (t *DbService) ListTables(request *ListTablesRequest) (*ListTablesResponse, error) { + rsp := &ListTablesResponse{} + return rsp, t.client.Call("db", "ListTables", request, rsp) +} + // Read data from a table. Lookup can be by ID or via querying any field in the record. func (t *DbService) Read(request *ReadRequest) (*ReadResponse, error) { rsp := &ReadResponse{} return rsp, t.client.Call("db", "Read", request, rsp) } +// +func (t *DbService) RenameTable(request *RenameTableRequest) (*RenameTableResponse, error) { + rsp := &RenameTableResponse{} + return rsp, t.client.Call("db", "RenameTable", request, rsp) +} + // Truncate the records in a table func (t *DbService) Truncate(request *TruncateRequest) (*TruncateResponse, error) { rsp := &TruncateResponse{} @@ -84,6 +96,13 @@ type DeleteRequest struct { type DeleteResponse struct { } +type ListTablesRequest struct { +} + +type ListTablesResponse struct { + Tables []string `json:"tables"` +} + type ReadRequest struct { // Read by id. Equivalent to 'id == "your-id"' Id string `json:"id"` @@ -110,6 +129,14 @@ type ReadResponse struct { Records []map[string]interface{} `json:"records"` } +type RenameTableRequest struct { + From string `json:"from"` + To string `json:"to"` +} + +type RenameTableResponse struct { +} + type TruncateRequest struct { // Optional table name. Defaults to 'default' Table string `json:"table"` diff --git a/clients/ts/package.json b/clients/ts/package.json index e27e3c5..0daf4f2 100644 --- a/clients/ts/package.json +++ b/clients/ts/package.json @@ -78,5 +78,5 @@ "prepare": "npm run build" }, "types": "index.d.ts", - "version": "1.0.706" + "version": "1.0.717" } \ No newline at end of file diff --git a/examples/db/create/go/createARecord.go b/examples/db/create/go/createARecord.go index 08be46f..283dd5d 100755 --- a/examples/db/create/go/createARecord.go +++ b/examples/db/create/go/createARecord.go @@ -12,10 +12,10 @@ func CreateArecord() { dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN")) rsp, err := dbService.Create(&db.CreateRequest{ Record: map[string]interface{}{ - "age": 42, - "isActive": true, "id": "1", "name": "Jane", + "age": 42, + "isActive": true, }, Table: "users", }) diff --git a/examples/event/publish/go/publishAnEvent.go b/examples/event/publish/go/publishAnEvent.go index a6a3b0e..cd945dc 100755 --- a/examples/event/publish/go/publishAnEvent.go +++ b/examples/event/publish/go/publishAnEvent.go @@ -12,9 +12,9 @@ func PublishAnEvent() { eventService := event.NewEventService(os.Getenv("MICRO_API_TOKEN")) rsp, err := eventService.Publish(&event.PublishRequest{ Message: map[string]interface{}{ + "id": "1", "type": "signup", "user": "john", - "id": "1", }, Topic: "user", }) diff --git a/examples/mq/publish/go/publishAMessage.go b/examples/mq/publish/go/publishAMessage.go index e3cfd27..6cbfe0d 100755 --- a/examples/mq/publish/go/publishAMessage.go +++ b/examples/mq/publish/go/publishAMessage.go @@ -12,9 +12,9 @@ func PublishAmessage() { mqService := mq.NewMqService(os.Getenv("MICRO_API_TOKEN")) rsp, err := mqService.Publish(&mq.PublishRequest{ Message: map[string]interface{}{ + "type": "signup", "user": "john", "id": "1", - "type": "signup", }, Topic: "events", })