database

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Example (RespDBlist_json)
display.Print(
	&respDBList{Info: []*types.DatasetIdentifier{
		{
			Name:  "db_a",
			Owner: mustDecodeHex("6f776e6572"),
			DBID:  "xabc",
		},
		{
			Name:  "db_b",
			Owner: mustDecodeHex("6f776e6572"),
			DBID:  "xdef",
		},
	}},
	nil, "json")
Output:

{
  "result": [
    {
      "name": "db_a",
      "owner": "6f776e6572",
      "dbid": "xabc"
    },
    {
      "name": "db_b",
      "owner": "6f776e6572",
      "dbid": "xdef"
    }
  ],
  "error": ""
}
Example (RespDBlist_text)
display.Print(
	&respDBList{Info: []*types.DatasetIdentifier{
		{
			Name:  "db_a",
			Owner: mustDecodeHex("6f776e6572"),
			DBID:  "xabc",
		},
		{
			Name:  "db_b",
			Owner: mustDecodeHex("6f776e6572"),
			DBID:  "xdef",
		},
	},
		owner: mustDecodeHex("6f776e6572")},
	nil, "text")
Output:

Databases belonging to '6f776e6572':
  DBID: xabc
    Name: db_a
    Owner: 6f776e6572
  DBID: xdef
    Name: db_b
    Owner: 6f776e6572
Example (RespDBlist_text_0)
display.Print(
	&respDBList{Info: []*types.DatasetIdentifier{}, owner: mustDecodeHex("6f776e6572")},
	nil, "text")
Output:

No databases found for '6f776e6572'.
Example (RespRelations_json)
display.Print(&respRelations{
	Data: clientType.NewRecordsFromMaps([]map[string]any{{"a": "1", "b": "2"}, {"a": "3", "b": "4"}})},
	nil, "json")
Output:

{
  "result": [
    {
      "a": "1",
      "b": "2"
    },
    {
      "a": "3",
      "b": "4"
    }
  ],
  "error": ""
}
Example (RespRelations_text)
display.Print(&respRelations{
	Data: clientType.NewRecordsFromMaps([]map[string]any{{"a": "1", "b": "2"}, {"a": "3", "b": "4"}})},
	nil, "text")
Output:

| a | b |
+---+---+
| 1 | 2 |
| 3 | 4 |
Example (RespSchema_text)
display.Print(demoSchema, nil, "text")
Output:

Tables:
  users
    Columns:
    id
      Type: int
      primary_key
        true
Actions:
  get_user (public)
    Inputs: [user_id]
Procedures:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdDatabase

func NewCmdDatabase() *cobra.Command

func UnmarshalJson

func UnmarshalJson(file *os.File) (*types.Schema, error)

func UnmarshalKf

func UnmarshalKf(file *os.File) (*types.Schema, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL