Skip to content
This page View Markdown Open in ChatGPT Open in Claude

Get all

The code in every language

Each example is the inside of main, written in every language API Maker runs : pick yours in the tabs, and every page shows it from then on. The types a call takes (GetAll, DeepItem…) are those of am : from am import GetAll in Python, use am::GetAll; in Rust, import am.GetAll; in Java and Kotlin ; PHP and C# have them without an import, Go names them am.GetAll.

g.sys.db.getAll calls the get all schema API of any table from your code, with the same headers and query parameters as over HTTP. It returns the data. The whole envelope (success, statusCode, data, totalCount, errors…) comes back when true is passed as the second argument in TypeScript, and through full in the other languages : g.sys.db.full (g.Sys.Db.Full in C# and Go, $g->sys->db->full in PHP).

Get all data

Get all data from table 'customers'
1
2
3
let getAll = await g.sys.db.getAll({
    instance: "mysql_8", database: "inventory", collection: "customers",
});
Get all data from table 'customers'
1
2
3
get_all = await g.sys.db.get_all(
    'mysql_8', 'inventory', 'customers',
)
Get all data from table 'customers'
1
2
3
$getAll = $g->sys->db->getAll(
    'mysql_8', 'inventory', 'customers',
);
Get all data from table 'customers'
var getAll = await g.Sys.Db.GetAll(new GetAll("mysql_8", "inventory", "customers"));
Get all data from table 'customers'
1
2
3
4
5
6
getAll, err := g.Sys.Db.GetAll(am.GetAll{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
})
if err != nil {
    return nil, err
}
Get all data from table 'customers'
let get_all = g.sys.db.get_all(GetAll::new("mysql_8", "inventory", "customers"))?;
Get all data from table 'customers'
var getAll = g.sys.db.getAll(new GetAll("mysql_8", "inventory", "customers"));
Get all data from table 'customers'
val getAll = g.sys.db.getAll(GetAll("mysql_8", "inventory", "customers"))

With header

Get all with header
1
2
3
4
5
6
let getAll = await g.sys.db.getAll({
    instance: "mysql_8", database: "inventory", collection: "customers",
    headers: {
        "x-am-response-case": "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
    },
});
Get all with header
1
2
3
4
5
6
get_all = await g.sys.db.get_all(
    'mysql_8', 'inventory', 'customers',
    headers={
        'x-am-response-case': 'capitalCase',  # noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
    },
)
Get all with header
1
2
3
4
5
6
$getAll = $g->sys->db->getAll(
    'mysql_8', 'inventory', 'customers',
    headers: [
        'x-am-response-case' => 'capitalCase', // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
    ],
);
Get all with header
1
2
3
4
5
6
7
var getAll = await g.Sys.Db.GetAll(new GetAll("mysql_8", "inventory", "customers")
{
    Headers = new JsonObject
    {
        ["x-am-response-case"] = "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
    },
});
Get all with header
1
2
3
4
5
6
7
8
9
getAll, err := g.Sys.Db.GetAll(am.GetAll{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Headers: am.M{
        "x-am-response-case": "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
    },
})
if err != nil {
    return nil, err
}
Get all with header
1
2
3
4
5
6
let get_all = g.sys.db.get_all(
    GetAll::new("mysql_8", "inventory", "customers")
        .headers(json!({
            "x-am-response-case": "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        })),
)?;
Get all with header
1
2
3
4
var getAll = g.sys.db.getAll(new GetAll("mysql_8", "inventory", "customers")
    .headers(Map.of(
        "x-am-response-case", "capitalCase" // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
    )));
Get all with header
1
2
3
4
5
6
val getAll = g.sys.db.getAll(
    GetAll("mysql_8", "inventory", "customers")
        .headers(mapOf(
            "x-am-response-case" to "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        )),
)

With queryParams

Get all with queryParams
1
2
3
4
5
6
7
8
let getAll = await g.sys.db.getAll({
    instance: "mysql_8", database: "inventory", collection: "customers",
    queryParams: {
        find: {
            first_name: 'James',
        },
    },
}, true);
Get all with queryParams
1
2
3
4
5
6
get_all = await g.sys.db.full.get_all(
    'mysql_8', 'inventory', 'customers',
    find={
        'first_name': 'James',
    },
)
Get all with queryParams
1
2
3
4
5
6
$getAll = $g->sys->db->full->getAll(
    'mysql_8', 'inventory', 'customers',
    find: [
        'first_name' => 'James',
    ],
);
Get all with queryParams
1
2
3
4
5
6
7
var getAll = await g.Sys.Db.Full.GetAll(new GetAll("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["first_name"] = "James",
    },
});
Get all with queryParams
1
2
3
4
5
6
7
8
9
getAll, err := g.Sys.Db.Full.GetAll(am.GetAll{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "first_name": "James",
    },
})
if err != nil {
    return nil, err
}
Get all with queryParams
1
2
3
4
5
6
let get_all = g.sys.db.full.get_all(
    GetAll::new("mysql_8", "inventory", "customers")
        .find(json!({
            "first_name": "James",
        })),
)?;
Get all with queryParams
1
2
3
4
var getAll = g.sys.db.full.getAll(new GetAll("mysql_8", "inventory", "customers")
    .find(Map.of(
        "first_name", "James"
    )));
Get all with queryParams
1
2
3
4
5
6
val getAll = g.sys.db.full.getAll(
    GetAll("mysql_8", "inventory", "customers")
        .find(mapOf(
            "first_name" to "James",
        )),
)

Every header and query param

Structure of get all schema API
let getAll = await g.sys.db.getAll({
    instance: "INSTANCE_NAME", database: 'DB_NAME', collection: "COLLECTION_NAME",
    headers: {
        "x-am-response-case": "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        "x-am-response-object-type": "make_flat", // no_action | make_flat
        "x-am-meta": "true", // true, false
        "x-am-internationalization": "USER_I18N_ID",
        "x-am-run-in-sandbox": "2",
        "x-am-content-type-response": "text/xml", // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
        "x-am-cache-control": "reset_cache", // no_action | reset_cache
        "x-am-get-encrypted-data": "get_only_encryption", // no_encryption | get_only_encryption | get_data_and_encryption
        "x-am-sandbox-timeout": "13000",
        "x-no-compression": "true", // true | false
        "x-am-encrypted-payload": "true", // user will send 'true', when payload is encrypted for transfer
        // Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
        "x-am-tenant-username": "TENANT_USERNAME", // ex: acme
        // Authorization headers
        "x-am-authorization": "AUTHORIZATION_TOKEN",
        "x-am-user-authorization": "API_USER_TOKEN",
        "x-aws-authorization": "AWS_TOKEN",
        "x-google-authorization": "GOOGLE_TOKEN",
        "x-azure-authorization": "AZURE_TOKEN",
    },
    queryParams: {
        find: {
            "COLUMN_NAME": "COLUMN_VALUE"
        },
        skip: 1,
        limit: 5,
        sort: "COLUMN_NAME",
        select: "COMMA_SEPARATED_COLUMN_NAMES",
        getTotalCount: true,
        deep: [
            {
                s_key: "SOURCE_COLLECTION_COLUMN_NAME",
                t_instance: "TARGET_INSTANCE_NAME",
                t_db: "TARGET_DATABASE_NAME",
                t_col: "TARGET_COLLECTION_NAME",
                t_key: "TARGET_COLLECTION_COLUMN_NAME",
                find: {
                    "COLUMN_NAME": "COLUMN_VALUE"
                },
                isMultiple: true,
                limit: 10,
                select: "COMMA_SEPARATED_COLUMN_NAMES",
                skip: 2,
                sort: "COLUMN_NAME",
                deep: [
                    {
                        s_key: "SOURCE_COLLECTION_COLUMN_NAME",
                        t_instance: "TARGET_INSTANCE_NAME",
                        t_db: "TARGET_DATABASE_NAME",
                        t_col: "TARGET_COLLECTION_NAME",
                        t_key: "TARGET_COLLECTION_COLUMN_NAME",
                        find: {
                            "COLUMN_NAME": "COLUMN_VALUE"
                        },
                        isMultiple: true,
                        limit: 10,
                        select: "COMMA_SEPARATED_COLUMN_NAMES",
                        skip: 2,
                        sort: "COLUMN_NAME",
                    }
                ]
            }
        ]
    },
}, true);
Structure of get all schema API
get_all = await g.sys.db.full.get_all(
    'INSTANCE_NAME', 'DB_NAME', 'COLLECTION_NAME',
    headers={
        'x-am-response-case': 'capitalCase',  # noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        'x-am-response-object-type': 'make_flat',  # no_action | make_flat
        'x-am-meta': 'true',  # true, false
        'x-am-internationalization': 'USER_I18N_ID',
        'x-am-run-in-sandbox': '2',
        'x-am-content-type-response': 'text/xml',  # application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
        'x-am-cache-control': 'reset_cache',  # no_action | reset_cache
        'x-am-get-encrypted-data': 'get_only_encryption',  # no_encryption | get_only_encryption | get_data_and_encryption
        'x-am-sandbox-timeout': '13000',
        'x-no-compression': 'true',  # true | false
        'x-am-encrypted-payload': 'true',  # user will send 'true', when payload is encrypted for transfer
        # Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
        'x-am-tenant-username': 'TENANT_USERNAME',  # ex: acme
        # Authorization headers
        'x-am-authorization': 'AUTHORIZATION_TOKEN',
        'x-am-user-authorization': 'API_USER_TOKEN',
        'x-aws-authorization': 'AWS_TOKEN',
        'x-google-authorization': 'GOOGLE_TOKEN',
        'x-azure-authorization': 'AZURE_TOKEN',
    },
    find={
        'COLUMN_NAME': 'COLUMN_VALUE',
    },
    skip=1,
    limit=5,
    sort='COLUMN_NAME',
    select='COMMA_SEPARATED_COLUMN_NAMES',
    get_total_count=True,
    deep=[
        DeepItem(
            'SOURCE_COLLECTION_COLUMN_NAME',
            t_instance='TARGET_INSTANCE_NAME',
            t_db='TARGET_DATABASE_NAME',
            t_col='TARGET_COLLECTION_NAME',
            t_key='TARGET_COLLECTION_COLUMN_NAME',
            find={
                'COLUMN_NAME': 'COLUMN_VALUE',
            },
            is_multiple=True,
            limit=10,
            select='COMMA_SEPARATED_COLUMN_NAMES',
            skip=2,
            sort='COLUMN_NAME',
            deep=[
                DeepItem(
                    'SOURCE_COLLECTION_COLUMN_NAME',
                    t_instance='TARGET_INSTANCE_NAME',
                    t_db='TARGET_DATABASE_NAME',
                    t_col='TARGET_COLLECTION_NAME',
                    t_key='TARGET_COLLECTION_COLUMN_NAME',
                    find={
                        'COLUMN_NAME': 'COLUMN_VALUE',
                    },
                    is_multiple=True,
                    limit=10,
                    select='COMMA_SEPARATED_COLUMN_NAMES',
                    skip=2,
                    sort='COLUMN_NAME',
                ),
            ],
        ),
    ],
)
Structure of get all schema API
$getAll = $g->sys->db->full->getAll(
    'INSTANCE_NAME', 'DB_NAME', 'COLLECTION_NAME',
    headers: [
        'x-am-response-case' => 'capitalCase', // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        'x-am-response-object-type' => 'make_flat', // no_action | make_flat
        'x-am-meta' => 'true', // true, false
        'x-am-internationalization' => 'USER_I18N_ID',
        'x-am-run-in-sandbox' => '2',
        'x-am-content-type-response' => 'text/xml', // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
        'x-am-cache-control' => 'reset_cache', // no_action | reset_cache
        'x-am-get-encrypted-data' => 'get_only_encryption', // no_encryption | get_only_encryption | get_data_and_encryption
        'x-am-sandbox-timeout' => '13000',
        'x-no-compression' => 'true', // true | false
        'x-am-encrypted-payload' => 'true', // user will send 'true', when payload is encrypted for transfer
        // Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
        'x-am-tenant-username' => 'TENANT_USERNAME', // ex: acme
        // Authorization headers
        'x-am-authorization' => 'AUTHORIZATION_TOKEN',
        'x-am-user-authorization' => 'API_USER_TOKEN',
        'x-aws-authorization' => 'AWS_TOKEN',
        'x-google-authorization' => 'GOOGLE_TOKEN',
        'x-azure-authorization' => 'AZURE_TOKEN',
    ],
    find: [
        'COLUMN_NAME' => 'COLUMN_VALUE',
    ],
    skip: 1,
    limit: 5,
    sort: 'COLUMN_NAME',
    select: 'COMMA_SEPARATED_COLUMN_NAMES',
    getTotalCount: true,
    deep: [
        new DeepItem(
            'SOURCE_COLLECTION_COLUMN_NAME',
            tInstance: 'TARGET_INSTANCE_NAME',
            tDb: 'TARGET_DATABASE_NAME',
            tCol: 'TARGET_COLLECTION_NAME',
            tKey: 'TARGET_COLLECTION_COLUMN_NAME',
            find: [
                'COLUMN_NAME' => 'COLUMN_VALUE',
            ],
            isMultiple: true,
            limit: 10,
            select: 'COMMA_SEPARATED_COLUMN_NAMES',
            skip: 2,
            sort: 'COLUMN_NAME',
            deep: [
                new DeepItem(
                    'SOURCE_COLLECTION_COLUMN_NAME',
                    tInstance: 'TARGET_INSTANCE_NAME',
                    tDb: 'TARGET_DATABASE_NAME',
                    tCol: 'TARGET_COLLECTION_NAME',
                    tKey: 'TARGET_COLLECTION_COLUMN_NAME',
                    find: [
                        'COLUMN_NAME' => 'COLUMN_VALUE',
                    ],
                    isMultiple: true,
                    limit: 10,
                    select: 'COMMA_SEPARATED_COLUMN_NAMES',
                    skip: 2,
                    sort: 'COLUMN_NAME',
                ),
            ],
        ),
    ],
);
Structure of get all schema API
var getAll = await g.Sys.Db.Full.GetAll(new GetAll("INSTANCE_NAME", "DB_NAME", "COLLECTION_NAME")
{
    Headers = new JsonObject
    {
        ["x-am-response-case"] = "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        ["x-am-response-object-type"] = "make_flat", // no_action | make_flat
        ["x-am-meta"] = "true", // true, false
        ["x-am-internationalization"] = "USER_I18N_ID",
        ["x-am-run-in-sandbox"] = "2",
        ["x-am-content-type-response"] = "text/xml", // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
        ["x-am-cache-control"] = "reset_cache", // no_action | reset_cache
        ["x-am-get-encrypted-data"] = "get_only_encryption", // no_encryption | get_only_encryption | get_data_and_encryption
        ["x-am-sandbox-timeout"] = "13000",
        ["x-no-compression"] = "true", // true | false
        ["x-am-encrypted-payload"] = "true", // user will send 'true', when payload is encrypted for transfer
        // Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
        ["x-am-tenant-username"] = "TENANT_USERNAME", // ex: acme
        // Authorization headers
        ["x-am-authorization"] = "AUTHORIZATION_TOKEN",
        ["x-am-user-authorization"] = "API_USER_TOKEN",
        ["x-aws-authorization"] = "AWS_TOKEN",
        ["x-google-authorization"] = "GOOGLE_TOKEN",
        ["x-azure-authorization"] = "AZURE_TOKEN",
    },
    Find = new JsonObject
    {
        ["COLUMN_NAME"] = "COLUMN_VALUE",
    },
    Skip = 1,
    Limit = 5,
    Sort = "COLUMN_NAME",
    Select = "COMMA_SEPARATED_COLUMN_NAMES",
    GetTotalCount = true,
    Deep = new[]
    {
        new DeepItem("SOURCE_COLLECTION_COLUMN_NAME")
        {
            TInstance = "TARGET_INSTANCE_NAME",
            TDb = "TARGET_DATABASE_NAME",
            TCol = "TARGET_COLLECTION_NAME",
            TKey = "TARGET_COLLECTION_COLUMN_NAME",
            Find = new JsonObject
            {
                ["COLUMN_NAME"] = "COLUMN_VALUE",
            },
            IsMultiple = true,
            Limit = 10,
            Select = "COMMA_SEPARATED_COLUMN_NAMES",
            Skip = 2,
            Sort = "COLUMN_NAME",
            Deep = new[]
            {
                new DeepItem("SOURCE_COLLECTION_COLUMN_NAME")
                {
                    TInstance = "TARGET_INSTANCE_NAME",
                    TDb = "TARGET_DATABASE_NAME",
                    TCol = "TARGET_COLLECTION_NAME",
                    TKey = "TARGET_COLLECTION_COLUMN_NAME",
                    Find = new JsonObject
                    {
                        ["COLUMN_NAME"] = "COLUMN_VALUE",
                    },
                    IsMultiple = true,
                    Limit = 10,
                    Select = "COMMA_SEPARATED_COLUMN_NAMES",
                    Skip = 2,
                    Sort = "COLUMN_NAME",
                },
            },
        },
    },
});
Structure of get all schema API
getAll, err := g.Sys.Db.Full.GetAll(am.GetAll{
    Instance: "INSTANCE_NAME", Database: "DB_NAME", Collection: "COLLECTION_NAME",
    Headers: am.M{
        "x-am-response-case":         "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        "x-am-response-object-type":  "make_flat",   // no_action | make_flat
        "x-am-meta":                  "true",        // true, false
        "x-am-internationalization":  "USER_I18N_ID",
        "x-am-run-in-sandbox":        "2",
        "x-am-content-type-response": "text/xml",            // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
        "x-am-cache-control":         "reset_cache",         // no_action | reset_cache
        "x-am-get-encrypted-data":    "get_only_encryption", // no_encryption | get_only_encryption | get_data_and_encryption
        "x-am-sandbox-timeout":       "13000",
        "x-no-compression":           "true", // true | false
        "x-am-encrypted-payload":     "true", // user will send 'true', when payload is encrypted for transfer
        // Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
        "x-am-tenant-username": "TENANT_USERNAME", // ex: acme
        // Authorization headers
        "x-am-authorization":      "AUTHORIZATION_TOKEN",
        "x-am-user-authorization": "API_USER_TOKEN",
        "x-aws-authorization":     "AWS_TOKEN",
        "x-google-authorization":  "GOOGLE_TOKEN",
        "x-azure-authorization":   "AZURE_TOKEN",
    },
    Find: am.M{
        "COLUMN_NAME": "COLUMN_VALUE",
    },
    Skip:          1,
    Limit:         5,
    Sort:          "COLUMN_NAME",
    Select:        "COMMA_SEPARATED_COLUMN_NAMES",
    GetTotalCount: true,
    Deep: []am.DeepItem{
        {
            SKey:      "SOURCE_COLLECTION_COLUMN_NAME",
            TInstance: "TARGET_INSTANCE_NAME",
            TDb:       "TARGET_DATABASE_NAME",
            TCol:      "TARGET_COLLECTION_NAME",
            TKey:      "TARGET_COLLECTION_COLUMN_NAME",
            Find: am.M{
                "COLUMN_NAME": "COLUMN_VALUE",
            },
            IsMultiple: true,
            Limit:      10,
            Select:     "COMMA_SEPARATED_COLUMN_NAMES",
            Skip:       2,
            Sort:       "COLUMN_NAME",
            Deep: []am.DeepItem{
                {
                    SKey:      "SOURCE_COLLECTION_COLUMN_NAME",
                    TInstance: "TARGET_INSTANCE_NAME",
                    TDb:       "TARGET_DATABASE_NAME",
                    TCol:      "TARGET_COLLECTION_NAME",
                    TKey:      "TARGET_COLLECTION_COLUMN_NAME",
                    Find: am.M{
                        "COLUMN_NAME": "COLUMN_VALUE",
                    },
                    IsMultiple: true,
                    Limit:      10,
                    Select:     "COMMA_SEPARATED_COLUMN_NAMES",
                    Skip:       2,
                    Sort:       "COLUMN_NAME",
                },
            },
        },
    },
})
if err != nil {
    return nil, err
}
Structure of get all schema API
let get_all = g.sys.db.full.get_all(
    GetAll::new("INSTANCE_NAME", "DB_NAME", "COLLECTION_NAME")
        .headers(json!({
            "x-am-response-case": "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
            "x-am-response-object-type": "make_flat", // no_action | make_flat
            "x-am-meta": "true", // true, false
            "x-am-internationalization": "USER_I18N_ID",
            "x-am-run-in-sandbox": "2",
            "x-am-content-type-response": "text/xml", // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
            "x-am-cache-control": "reset_cache", // no_action | reset_cache
            "x-am-get-encrypted-data": "get_only_encryption", // no_encryption | get_only_encryption | get_data_and_encryption
            "x-am-sandbox-timeout": "13000",
            "x-no-compression": "true", // true | false
            "x-am-encrypted-payload": "true", // user will send 'true', when payload is encrypted for transfer
            // Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
            "x-am-tenant-username": "TENANT_USERNAME", // ex: acme
            // Authorization headers
            "x-am-authorization": "AUTHORIZATION_TOKEN",
            "x-am-user-authorization": "API_USER_TOKEN",
            "x-aws-authorization": "AWS_TOKEN",
            "x-google-authorization": "GOOGLE_TOKEN",
            "x-azure-authorization": "AZURE_TOKEN",
        }))
        .find(json!({
            "COLUMN_NAME": "COLUMN_VALUE",
        }))
        .skip(1)
        .limit(5)
        .sort("COLUMN_NAME")
        .select("COMMA_SEPARATED_COLUMN_NAMES")
        .get_total_count(true)
        .deep(vec![
            DeepItem::new("SOURCE_COLLECTION_COLUMN_NAME")
                .t_instance("TARGET_INSTANCE_NAME")
                .t_db("TARGET_DATABASE_NAME")
                .t_col("TARGET_COLLECTION_NAME")
                .t_key("TARGET_COLLECTION_COLUMN_NAME")
                .find(json!({
                    "COLUMN_NAME": "COLUMN_VALUE",
                }))
                .is_multiple(true)
                .limit(10)
                .select("COMMA_SEPARATED_COLUMN_NAMES")
                .skip(2)
                .sort("COLUMN_NAME")
                .deep(vec![
                    DeepItem::new("SOURCE_COLLECTION_COLUMN_NAME")
                        .t_instance("TARGET_INSTANCE_NAME")
                        .t_db("TARGET_DATABASE_NAME")
                        .t_col("TARGET_COLLECTION_NAME")
                        .t_key("TARGET_COLLECTION_COLUMN_NAME")
                        .find(json!({
                            "COLUMN_NAME": "COLUMN_VALUE",
                        }))
                        .is_multiple(true)
                        .limit(10)
                        .select("COMMA_SEPARATED_COLUMN_NAMES")
                        .skip(2)
                        .sort("COLUMN_NAME"),
                ]),
        ]),
)?;
Structure of get all schema API
var getAll = g.sys.db.full.getAll(new GetAll("INSTANCE_NAME", "DB_NAME", "COLLECTION_NAME")
    .headers(JsonObject.of(
        "x-am-response-case", "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        "x-am-response-object-type", "make_flat", // no_action | make_flat
        "x-am-meta", "true", // true, false
        "x-am-internationalization", "USER_I18N_ID",
        "x-am-run-in-sandbox", "2",
        "x-am-content-type-response", "text/xml", // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
        "x-am-cache-control", "reset_cache", // no_action | reset_cache
        "x-am-get-encrypted-data", "get_only_encryption", // no_encryption | get_only_encryption | get_data_and_encryption
        "x-am-sandbox-timeout", "13000",
        "x-no-compression", "true", // true | false
        "x-am-encrypted-payload", "true", // user will send 'true', when payload is encrypted for transfer
        // Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
        "x-am-tenant-username", "TENANT_USERNAME", // ex: acme
        // Authorization headers
        "x-am-authorization", "AUTHORIZATION_TOKEN",
        "x-am-user-authorization", "API_USER_TOKEN",
        "x-aws-authorization", "AWS_TOKEN",
        "x-google-authorization", "GOOGLE_TOKEN",
        "x-azure-authorization", "AZURE_TOKEN"
    ))
    .find(Map.of(
        "COLUMN_NAME", "COLUMN_VALUE"
    ))
    .skip(1)
    .limit(5)
    .sort("COLUMN_NAME")
    .select("COMMA_SEPARATED_COLUMN_NAMES")
    .getTotalCount(true)
    .deep(List.of(
        new DeepItem("SOURCE_COLLECTION_COLUMN_NAME")
            .tInstance("TARGET_INSTANCE_NAME")
            .tDb("TARGET_DATABASE_NAME")
            .tCol("TARGET_COLLECTION_NAME")
            .tKey("TARGET_COLLECTION_COLUMN_NAME")
            .find(Map.of(
                "COLUMN_NAME", "COLUMN_VALUE"
            ))
            .isMultiple(true)
            .limit(10)
            .select("COMMA_SEPARATED_COLUMN_NAMES")
            .skip(2)
            .sort("COLUMN_NAME")
            .deep(List.of(
                new DeepItem("SOURCE_COLLECTION_COLUMN_NAME")
                    .tInstance("TARGET_INSTANCE_NAME")
                    .tDb("TARGET_DATABASE_NAME")
                    .tCol("TARGET_COLLECTION_NAME")
                    .tKey("TARGET_COLLECTION_COLUMN_NAME")
                    .find(Map.of(
                        "COLUMN_NAME", "COLUMN_VALUE"
                    ))
                    .isMultiple(true)
                    .limit(10)
                    .select("COMMA_SEPARATED_COLUMN_NAMES")
                    .skip(2)
                    .sort("COLUMN_NAME")
            ))
    )));
Structure of get all schema API
val getAll = g.sys.db.full.getAll(
    GetAll("INSTANCE_NAME", "DB_NAME", "COLLECTION_NAME")
        .headers(mapOf(
            "x-am-response-case" to "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
            "x-am-response-object-type" to "make_flat", // no_action | make_flat
            "x-am-meta" to "true", // true, false
            "x-am-internationalization" to "USER_I18N_ID",
            "x-am-run-in-sandbox" to "2",
            "x-am-content-type-response" to "text/xml", // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
            "x-am-cache-control" to "reset_cache", // no_action | reset_cache
            "x-am-get-encrypted-data" to "get_only_encryption", // no_encryption | get_only_encryption | get_data_and_encryption
            "x-am-sandbox-timeout" to "13000",
            "x-no-compression" to "true", // true | false
            "x-am-encrypted-payload" to "true", // user will send 'true', when payload is encrypted for transfer
            // Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
            "x-am-tenant-username" to "TENANT_USERNAME", // ex: acme
            // Authorization headers
            "x-am-authorization" to "AUTHORIZATION_TOKEN",
            "x-am-user-authorization" to "API_USER_TOKEN",
            "x-aws-authorization" to "AWS_TOKEN",
            "x-google-authorization" to "GOOGLE_TOKEN",
            "x-azure-authorization" to "AZURE_TOKEN",
        ))
        .find(mapOf(
            "COLUMN_NAME" to "COLUMN_VALUE",
        ))
        .skip(1)
        .limit(5)
        .sort("COLUMN_NAME")
        .select("COMMA_SEPARATED_COLUMN_NAMES")
        .getTotalCount(true)
        .deep(listOf(
            DeepItem("SOURCE_COLLECTION_COLUMN_NAME")
                .tInstance("TARGET_INSTANCE_NAME")
                .tDb("TARGET_DATABASE_NAME")
                .tCol("TARGET_COLLECTION_NAME")
                .tKey("TARGET_COLLECTION_COLUMN_NAME")
                .find(mapOf(
                    "COLUMN_NAME" to "COLUMN_VALUE",
                ))
                .isMultiple(true)
                .limit(10)
                .select("COMMA_SEPARATED_COLUMN_NAMES")
                .skip(2)
                .sort("COLUMN_NAME")
                .deep(listOf(
                    DeepItem("SOURCE_COLLECTION_COLUMN_NAME")
                        .tInstance("TARGET_INSTANCE_NAME")
                        .tDb("TARGET_DATABASE_NAME")
                        .tCol("TARGET_COLLECTION_NAME")
                        .tKey("TARGET_COLLECTION_COLUMN_NAME")
                        .find(mapOf(
                            "COLUMN_NAME" to "COLUMN_VALUE",
                        ))
                        .isMultiple(true)
                        .limit(10)
                        .select("COMMA_SEPARATED_COLUMN_NAMES")
                        .skip(2)
                        .sort("COLUMN_NAME"),
                )),
        )),
)

Multi-tenant

  • instance: "crm::acme" works on the database of the tenant acme of the multi-tenant instance crm.
  • With instance: "crm", the call works on the database of the tenant of the request: a custom API called with the x-am-tenant-username header passes it on to the APIs it calls. A request without a tenant works on the structure database.
Get all customers of the tenant acme
1
2
3
4
5
6
let getAll = await g.sys.db.getAll({
    instance: "crm::acme", database: "crm", collection: "customers",
    queryParams: {
        sort: "customer_id"
    }
});
Get all customers of the tenant acme
1
2
3
4
get_all = await g.sys.db.get_all(
    'crm::acme', 'crm', 'customers',
    sort='customer_id',
)
Get all customers of the tenant acme
1
2
3
4
$getAll = $g->sys->db->getAll(
    'crm::acme', 'crm', 'customers',
    sort: 'customer_id',
);
Get all customers of the tenant acme
1
2
3
4
var getAll = await g.Sys.Db.GetAll(new GetAll("crm::acme", "crm", "customers")
{
    Sort = "customer_id",
});
Get all customers of the tenant acme
1
2
3
4
5
6
7
getAll, err := g.Sys.Db.GetAll(am.GetAll{
    Instance: "crm::acme", Database: "crm", Collection: "customers",
    Sort: "customer_id",
})
if err != nil {
    return nil, err
}
Get all customers of the tenant acme
1
2
3
4
let get_all = g.sys.db.get_all(
    GetAll::new("crm::acme", "crm", "customers")
        .sort("customer_id"),
)?;
Get all customers of the tenant acme
var getAll = g.sys.db.getAll(new GetAll("crm::acme", "crm", "customers")
    .sort("customer_id"));
Get all customers of the tenant acme
1
2
3
4
val getAll = g.sys.db.getAll(
    GetAll("crm::acme", "crm", "customers")
        .sort("customer_id"),
)
Get all customers of the tenant globex, named with the header of the call
1
2
3
4
5
6
let getAll = await g.sys.db.getAll({
    instance: "crm", database: "crm", collection: "customers",
    headers: {
        "x-am-tenant-username": "globex"
    }
});
Get all customers of the tenant globex, named with the header of the call
1
2
3
4
5
6
get_all = await g.sys.db.get_all(
    'crm', 'crm', 'customers',
    headers={
        'x-am-tenant-username': 'globex',
    },
)
Get all customers of the tenant globex, named with the header of the call
1
2
3
4
5
6
$getAll = $g->sys->db->getAll(
    'crm', 'crm', 'customers',
    headers: [
        'x-am-tenant-username' => 'globex',
    ],
);
Get all customers of the tenant globex, named with the header of the call
1
2
3
4
5
6
7
var getAll = await g.Sys.Db.GetAll(new GetAll("crm", "crm", "customers")
{
    Headers = new JsonObject
    {
        ["x-am-tenant-username"] = "globex",
    },
});
Get all customers of the tenant globex, named with the header of the call
1
2
3
4
5
6
7
8
9
getAll, err := g.Sys.Db.GetAll(am.GetAll{
    Instance: "crm", Database: "crm", Collection: "customers",
    Headers: am.M{
        "x-am-tenant-username": "globex",
    },
})
if err != nil {
    return nil, err
}
Get all customers of the tenant globex, named with the header of the call
1
2
3
4
5
6
let get_all = g.sys.db.get_all(
    GetAll::new("crm", "crm", "customers")
        .headers(json!({
            "x-am-tenant-username": "globex",
        })),
)?;
Get all customers of the tenant globex, named with the header of the call
1
2
3
4
var getAll = g.sys.db.getAll(new GetAll("crm", "crm", "customers")
    .headers(Map.of(
        "x-am-tenant-username", "globex"
    )));
Get all customers of the tenant globex, named with the header of the call
1
2
3
4
5
6
val getAll = g.sys.db.getAll(
    GetAll("crm", "crm", "customers")
        .headers(mapOf(
            "x-am-tenant-username" to "globex",
        )),
)

Without a schema

g.sys.db.gen.getAllGen takes the same arguments and calls the get all generated API : no schema, so the data is read and written as it is in the table, without the conversions, validations and defaults of the schema.

Language The call
TypeScript g.sys.db.gen.getAllGen(…)
Python g.sys.db.gen.get_all_gen(…)
PHP $g->sys->db->gen->getAllGen(…)
C#, Go g.Sys.Db.Gen.GetAllGen(…)
Rust g.sys.db.get_all_gen(GetAll::new(…))
Java, Kotlin g.sys.db.gen.getAllGen(…)