Execute query
g.sys.system.executeQuery calls the execute plain query system API from your code, whatever the settings of that API say about HTTP callers.
Execute query System API¶
Execute database query using global object 'g'.
- If the database is Mongodb API Maker supports all the commands listed in below.
- https://www.mongodb.com/docs/drivers/node/current/usage-examples/command/
- https://www.mongodb.com/docs/v6.0/reference/command/
How we use Native Query in API Maker.¶
Native query using secret management¶
-
Set Database constrain in Secret management.
-
Get Database constrain from Secret management.
-
Create table
Various types of Database & It`s Native Query In API Maker¶
-
MySQL | TiDB | Percona XtraDB
-
MariaDB
-
Microsoft SQL Server
-
MongoDB
-
PostgreSQL
-
Oracle
Please follow these rules when writing a query or statement:
- Use backticks (`) to enclose your query or statement.
- Do not add a semicolon (;) at the end of your query.
DDL Operation in API Maker¶
-
CREATE TABLE
-
ALTER TABLE
-
RENAME TABLE
-
TRUNCATE TABLE
-
DROP TABLE
DML Operation in API Maker¶
API Maker allows us to perform various DML operations, such as the following examples.
-
INSERT
-
DELETE
-
UPDATE
DQL Operation in API Maker¶
API Maker allows us to perform various DQL operations, such as the following examples.
-
SELECT
-
DISTINCT
-
ORDER BY
Aggregated Function in API Maker¶
API Maker allows us to perform various Aggregated Function, such as the following examples.
-
SUM
-
AVG
Joins in API Maker¶
API Maker allows us to perform Joins, such as the following examples.
-
INNER JOIN
-
LEFT JOIN
How to call SQL Server Store Procedure¶
- Just replace your procedure name with below "procedureName".
How to create index in Mongodb¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
Multi-tenant¶
instance: "crm::acme"runs the query in the database of the tenantacmeof the multi-tenant instancecrm.- In a custom API called for a tenant,
instance: "crm"runs it in the database of that tenant: the x-am-tenant-username header is passed on. Without a tenant, it runs in the structure database.