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 ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.