mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-13 11:35:26 +00:00
Commit from GitHub Actions (Publish APIs & Clients)
This commit is contained in:
@@ -2,8 +2,9 @@ package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/db"
|
||||
"os"
|
||||
|
||||
"github.com/micro/services/clients/go/db"
|
||||
)
|
||||
|
||||
// Count records in a table
|
||||
|
||||
@@ -2,8 +2,9 @@ package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/db"
|
||||
"os"
|
||||
|
||||
"github.com/micro/services/clients/go/db"
|
||||
)
|
||||
|
||||
// Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
|
||||
@@ -11,10 +12,10 @@ func CreateArecord() {
|
||||
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := dbService.Create(&db.CreateRequest{
|
||||
Record: map[string]interface{}{
|
||||
"name": "Jane",
|
||||
"age": 42,
|
||||
"isActive": true,
|
||||
"id": "1",
|
||||
"name": "Jane",
|
||||
},
|
||||
Table: "users",
|
||||
})
|
||||
|
||||
@@ -2,8 +2,9 @@ package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/db"
|
||||
"os"
|
||||
|
||||
"github.com/micro/services/clients/go/db"
|
||||
)
|
||||
|
||||
// Delete a record in the database by id.
|
||||
|
||||
@@ -2,8 +2,9 @@ package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/db"
|
||||
"os"
|
||||
|
||||
"github.com/micro/services/clients/go/db"
|
||||
)
|
||||
|
||||
// Read data from a table. Lookup can be by ID or via querying any field in the record.
|
||||
|
||||
@@ -2,8 +2,9 @@ package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/db"
|
||||
"os"
|
||||
|
||||
"github.com/micro/services/clients/go/db"
|
||||
)
|
||||
|
||||
// Truncate the records in a table
|
||||
|
||||
@@ -2,8 +2,9 @@ package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/db"
|
||||
"os"
|
||||
|
||||
"github.com/micro/services/clients/go/db"
|
||||
)
|
||||
|
||||
// Update a record in the database. Include an "id" in the record to update.
|
||||
|
||||
Reference in New Issue
Block a user