mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-13 11:35:26 +00:00
Commit from GitHub Actions (Generate Clients & Examples)
This commit is contained in:
6
examples/db/dropTable/curl/dropTable.sh
Executable file
6
examples/db/dropTable/curl/dropTable.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
curl "http://localhost:8080/db/DropTable" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"table": "users"
|
||||
}'
|
||||
17
examples/db/dropTable/go/dropTable.go
Executable file
17
examples/db/dropTable/go/dropTable.go
Executable file
@@ -0,0 +1,17 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/micro/services/clients/go/db"
|
||||
)
|
||||
|
||||
// Drop a table in the DB
|
||||
func DropTable() {
|
||||
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := dbService.DropTable(&db.DropTableRequest{
|
||||
Table: "users",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
12
examples/db/dropTable/node/dropTable.js
Executable file
12
examples/db/dropTable/node/dropTable.js
Executable file
@@ -0,0 +1,12 @@
|
||||
const { DbService } = require("m3o/db");
|
||||
|
||||
// Drop a table in the DB
|
||||
async function dropTable() {
|
||||
let dbService = new DbService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await dbService.dropTable({
|
||||
table: "users",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
dropTable();
|
||||
Reference in New Issue
Block a user