Tables
Service Id: platform6.storedprocedures
1. List a Tables Records¶
Header key | Description | Value |
---|---|---|
platform6.request.action |
The action to perform (required) | list.records |
tableId |
The table’s identifier (required) | |
fields |
A records of conditions used to filter the retrieved records | |
offset |
The number which indicates the distance between the table’s first record and the first record displayed (default to 0 ) |
|
limit |
The number of the retrieved records (by default, all the records are returned) | |
orderByFieldName |
The field by which the records are sorted | |
sortAscending |
Whether the sort is ascending or descending (default to true ) |
|
platform6.request.user |
The email address of the user sending the message |
Warning
All the header’s values must be strings!
A valid response will be:
Header key | Description |
---|---|
platform6.response.status |
OK |
results |
The retrieved table’s records |
fields |
The table’s fields |
Examples¶
We’ll use the Exchange_rates table for the examples.
Currency_From | Currency_To | Rate |
---|---|---|
ARS | USD | 0.069 |
AUD | USD | 0.724508 |
BDT | USD | 0.013 |
BRL | USD | 0.25 |
The call below will list all the table’s records without further settings.
def cm = [
headers: [
'platform6.request.action': 'list.records',
'tableId': 'Exchange_rates'
]
]
def request = p6.service.request('platform6.tables', cm)
print request.headers['results']
print request.headers['fields']
The output will be:
INFO [root] stdout: [["ARS","USD","0.069"],["AUD","USD","0.724508"],["BDT","USD","0.013"],["BRL","USD","0.25"]]
INFO [root] stdout: ["Currency_From","Currency_To","Rate"]
If the table is not found, it will return an error:
{
"message" : "Requested table is not found: 'Exchange_rates'.",
"stackTrace" : [
"io.platform6.common.util.P6Exception: Requested table is not found: 'Exchange_rates'.",
" at io.platform6.core.service.tables.TablesAction$class.recordsRecords(TablesAction.scala:29)",
" at io.platform6.core.service.tables.TablesService.recordsRecords(TablesService.scala:66)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessage(TablesService.scala:161)",
" at io.platform6.core.impl.servicecomponent.AbstractServiceComponent.onCommonMessage(AbstractServiceComponent.java:704)",
" at io.platform6.core.common.platform.messagebus.BusQueueController$ServiceQueueRunner.run(BusQueueController.java:183)",
" at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)",
" at java.util.concurrent.FutureTask.run(FutureTask.java:266)",
" at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)",
" at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)",
" at java.lang.Thread.run(Thread.java:748)"
]
}
Here are some examples with additional parameters:
-
The parameter
fields
is set to[ Rate: '0.15' ]
: it will return all the records for which the Rate field has the value0.15
.import groovy.json.JsonOutput def cm = [ headers: [ 'platform6.request.action': 'list.records', 'tableId': 'Exchange_rates', 'fields': JsonOutput.toJson([ Rate: '0.15' ]) ] ] print p6.service.request('platform6.tables', cm).headers['results']
The response will be:
INFO [root] stdout: [["CNY","USD","0.15"],["DKK","USD","0.15"]]
-
The parameter
offset
is set to1
: it will return all the records after the first record excluded.def cm = [ headers: [ 'platform6.request.action': 'list.records', 'tableId': 'Exchange_rates', 'offset': '1' ] ] print p6.service.request('platform6.tables', cm).headers['results']
The response will be:
INFO [root] stdout: [["AUD","USD","0.724508"],["BDT","USD","0.013"],["BRL","USD","0.25"]]
-
The parameter
limit
is set to2
: it will return the two first records of the table.def cm = [ headers: [ 'platform6.request.action': 'list.records', 'tableId': 'Exchange_rates', 'limit': '2' ] ] print p6.service.request('platform6.tables', cm).headers['results']
The response will be:
INFO [root] stdout: [["AUD","USD","0.724508"],["ARS","USD","0.069"]]
-
The parameters
orderByFieldName
is set toRate
andsortAscending
is set tofalse
: it will sort the records in descending order by the Rate field.def cm = [ headers: [ 'platform6.request.action': 'list.records', 'tableId': 'Exchange_rates', 'orderByFieldName': 'Rate', 'sortAscending': 'false' ] ] print p6.service.request('platform6.tables', cm).headers['results']
The response will be:
INFO [root] stdout: [["AUD","USD","0.724508"],["BRL","USD","0.25"],["ARS","USD","0.069"],["BDT","USD","0.013"]]
2. Upsert Records to a Table¶
Header key | Description | Value |
---|---|---|
platform6.request.action |
The action to perform (required) | upsert.records |
tableId |
The table’s identifier (required) | |
records |
A new set of records to insert into the table |
If a new record has the same values for the primary keys than an existing record, the existing record’s values are updated with the new ones.
If not, the new record is added to the table.
If the list of records is empty, nothing happens.
A valid response will be:
Header key | Description |
---|---|
platform6.response.status |
OK |
No headers are returned in the response.
Examples¶
We’ll use again the Exchange_rates table for the example.
Currency_From | Currency_To | Rate |
---|---|---|
ARS | USD | 0.069 |
AUD | USD | 0.724508 |
BDT | USD | 0.013 |
BRL | USD | 0.25 |
The fields Currency_From and Currency_To are the table’s primary keys.
import groovy.json.JsonOutput
def records = []
def record1 = [
Currency_From: 'CAD',
Currency_To: 'USD',
Rate: '0.728980'
]
records << record1
def record2 = [
Currency_From: 'CHF',
Currency_To: 'USD',
Rate: '1.03'
]
records << record2
def record3 = [
Currency_From: 'ARS',
Currency_To: 'USD',
Rate: '0.15'
]
records << record3
def cm = [
headers: [
'platform6.request.action': 'upsert.records',
'tableId': 'Exchange_rates',
'records': JsonOutput.toJson(records)
]
]
p6.service.request('platform6.tables', cm)
Since the record3’s primary keys already exist in the table, the field Rate will be updated with the new value.
The primary keys of the records record1 and record2 do not already exist in the table so the two records will be added to the table.
The resulting table will be:
Currency_From | Currency_To | Rate |
---|---|---|
ARS | USD | 0.15 |
AUD | USD | 0.724508 |
BDT | USD | 0.013 |
BRL | USD | 0.25 |
CAD | USD | 0.728980 |
CHF | USD | 1.03 |
3. Insert Records in a Table¶
Header key | Description | Value |
---|---|---|
platform6.request.action |
The action to perform (required) | insert.records |
tableId |
The table’s identifier (required) | |
records |
A new set of records to insert into the table |
A valid response will be:
Header key | Description |
---|---|
platform6.response.status |
OK |
4. Delete Records from a Table¶
Header key | Description | Value |
---|---|---|
platform6.request.action |
The action to perform (required) | delete.records |
tableId |
The table’s identifier (required) | |
records |
A new set of records to delete from the table |
A valid response will be:
Header key | Description |
---|---|
platform6.response.status |
OK |
5. Update Table Data Indexes¶
Header key | Description | Value |
---|---|---|
platform6.request.action |
The action to perform (required) | table.updateindexes |
tableId |
The table’s identifier (required) |
A valid response will be:
Header key | Description |
---|---|
platform6.response.status |
OK |
platform6.response.value |
[job id of indexing job] |
6. Test for Table Existence Given Name and AppKey¶
Header key | Description | Value |
---|---|---|
platform6.request.action |
The action to perform (required) | table.exist |
tableName |
The table’s name (required) | |
appKey |
The table’s appKey (required) |
A valid response will be:
Header key | Description |
---|---|
platform6.response.status |
true |
7. Test for Table creation¶
Header key | Description | Value |
---|---|---|
platform6.request.action |
The action to perform (required) | table.create |
tableModel |
TableModel: JSON Table Model (required) |
A valid response will be:
Header key | Description |
---|---|
platform6.response.status |
OK |
8. Test for Table Existence Given Name and AppKey¶
Header key | Description | Value |
---|---|---|
platform6.request.action |
The action to perform (required) | table.fields |
tableId |
The table’s identifier (required) |
A valid response will be:
Header key | Description |
---|---|
platform6.response.status |
OK |
fields |
List |
keys |
List |
9. Test for Table Details Given Table Name and AppKey¶
Header key | Description | Value |
---|---|---|
platform6.request.action |
The action to perform (required) | table.details |
tableId |
The table’s identifier (required) | |
checkPermission |
boolean (Required for CMB requests) | |
scopes |
scope string (Required for CMB requests) |
A valid response will be:
Header key | Description |
---|---|
platform6.response.status |
OK |
value |
TableModelDetail table details |
If table does not exist, it will throw an exception
{
"message" : "io.platform6.common.util.P6Exception: Table: Amalto_O2C.AC_Item_status1, does not exist",
"stackTrace" : [
"io.platform6.common.util.P6Exception: io.platform6.common.util.P6Exception: Table: Amalto_O2C.AC_Item_status1, does not exist",
" at io.platform6.core.service.tables.TablesService.getTableModelDetails(TablesService.java:644)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessageRecordDetails(TablesService.java:413)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessage(TablesService.java:200)",
" at io.platform6.core.impl.servicecomponent.AbstractServiceComponent.onCommonMessage(AbstractServiceComponent.java:539)",
" at io.platform6.core.common.platform.messagebus.BusQueueController$ServiceQueueRunner.run(BusQueueController.java:146)",
" at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)",
" at java.base/java.util.concurrent.FutureTask.run(Unknown Source)",
" at java.base/java.lang.VirtualThread.run(Unknown Source)",
"Caused by: io.platform6.common.util.P6Exception: Table: Amalto_O2C.AC_Item_status1, does not exist",
" at io.platform6.core.service.tables.TablesService.lambda$getTableModelDetails$1(TablesService.java:627)",
" at java.base/java.util.Optional.orElseThrow(Unknown Source)",
" at io.platform6.core.service.tables.TablesService.getTableModelDetails(TablesService.java:627)",
" ... 7 more"
]
}
If user does not have right permissions, it will throw an error:
{
"message" : "io.platform6.common.http.exception.P6ResourceException: Unauthorized: you need to have the permission tables=allow.",
"stackTrace" : [
"io.platform6.common.util.P6Exception: io.platform6.common.http.exception.P6ResourceException: Unauthorized: you need to have the permission tables=allow.",
" at io.platform6.core.service.tables.TablesService.getTableModelDetails(TablesService.java:644)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessageRecordDetails(TablesService.java:413)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessage(TablesService.java:200)",
" at io.platform6.core.impl.servicecomponent.AbstractServiceComponent.onCommonMessage(AbstractServiceComponent.java:539)",
" at io.platform6.core.common.platform.messagebus.BusQueueController$ServiceQueueRunner.run(BusQueueController.java:146)",
" at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)",
" at java.base/java.util.concurrent.FutureTask.run(Unknown Source)",
" at java.base/java.lang.VirtualThread.run(Unknown Source)",
"Caused by: io.platform6.common.http.exception.P6ResourceException: Unauthorized: you need to have the permission tables=allow.",
" at io.platform6.core.service.tables.utils.PermissionUtils.tablePerm(PermissionUtils.java:36)",
" at io.platform6.core.service.tables.utils.PermissionUtils.tablePerm(PermissionUtils.java:25)",
" at io.platform6.core.service.tables.TablesService.checkPermission(TablesService.java:356)",
" at io.platform6.core.service.tables.TablesService.getTableModelDetails(TablesService.java:626)",
" ... 7 more"
]
}
10. Test for Table rename¶
Header key | Description | Value |
---|---|---|
platform6.request.action |
The action to perform (required) | table.rename |
oldId |
The table’s identifier (required) | |
oldId |
The table’s identifier (required) | |
language |
language | EN or FR |
checkPermission |
boolean (Required for CMB requests) | |
scopes |
scope string (Required for CMB requests) |
A valid response will be:
Header key | Description |
---|---|
platform6.response.status |
OK |
platform6.response.value |
TableModel |
keys |
List |
If table does not exist, it will throw an exception:
{
"message" : "Unexpected error renaming the item in the configuration!",
"stackTrace" : [
"io.platform6.common.util.P6Exception: Unexpected error renaming the item in the configuration!",
" at io.platform6.core.service.tables.TablesService.renameTable(TablesService.java:620)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessageTableRename(TablesService.java:303)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessage(TablesService.java:215)",
" at io.platform6.core.impl.servicecomponent.AbstractServiceComponent.onCommonMessage(AbstractServiceComponent.java:539)",
" at io.platform6.core.common.platform.messagebus.BusQueueController$ServiceQueueRunner.run(BusQueueController.java:146)",
" at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)",
" at java.base/java.util.concurrent.FutureTask.run(Unknown Source)",
" at java.base/java.lang.VirtualThread.run(Unknown Source)",
"Caused by: io.platform6.common.util.P6Exception: Unable to find the ServiceItem with id:raju-81",
" at io.platform6.core.impl.servicecomponent.configuration.DAOServiceConfigurationManager.lambda$getItem$0(DAOServiceConfigurationManager.java:173)",
" at java.base/java.util.Optional.orElseThrow(Unknown Source)",
" at io.platform6.core.impl.servicecomponent.configuration.DAOServiceConfigurationManager.getItem(DAOServiceConfigurationManager.java:173)",
" at io.platform6.core.service.tables.TablesService.renameTable(TablesService.java:574)",
" ... 7 more"
]
}
If user does not have right permissions, it will throw an error:
{
"message" : "Unexpected error renaming the item in the configuration!",
"stackTrace" : [
"io.platform6.common.util.P6Exception: Unexpected error renaming the item in the configuration!",
" at io.platform6.core.service.tables.TablesService.renameTable(TablesService.java:620)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessageTableRename(TablesService.java:303)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessage(TablesService.java:215)",
" at io.platform6.core.impl.servicecomponent.AbstractServiceComponent.onCommonMessage(AbstractServiceComponent.java:539)",
" at io.platform6.core.common.platform.messagebus.BusQueueController$ServiceQueueRunner.run(BusQueueController.java:146)",
" at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)",
" at java.base/java.util.concurrent.FutureTask.run(Unknown Source)",
" at java.base/java.lang.VirtualThread.run(Unknown Source)",
"Caused by: io.platform6.common.http.exception.P6ResourceException: Unauthorized: you need to have the permission tables=edit-table.",
" at io.platform6.core.service.tables.utils.PermissionUtils.tablePerm(PermissionUtils.java:40)",
" at io.platform6.core.service.tables.utils.PermissionUtils.tablePerm(PermissionUtils.java:25)",
" at io.platform6.core.service.tables.TablesService.checkPermission(TablesService.java:356)",
" at io.platform6.core.service.tables.TablesService.renameTable(TablesService.java:584)",
" ... 7 more"
]
}
If destination table already exists, it will throw an error
{
"message" : "Unexpected error renaming the item in the configuration!",
"stackTrace" : [
"io.platform6.common.util.P6Exception: Unexpected error renaming the item in the configuration!",
" at io.platform6.core.service.tables.TablesService.renameTable(TablesService.java:620)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessageTableRename(TablesService.java:303)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessage(TablesService.java:215)",
" at io.platform6.core.impl.servicecomponent.AbstractServiceComponent.onCommonMessage(AbstractServiceComponent.java:539)",
" at io.platform6.core.common.platform.messagebus.BusQueueController$ServiceQueueRunner.run(BusQueueController.java:146)",
" at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)",
" at java.base/java.util.concurrent.FutureTask.run(Unknown Source)",
" at java.base/java.lang.VirtualThread.run(Unknown Source)",
"Caused by: io.platform6.common.util.P6Exception: The name 'raju-1' is already used. Choose another name.",
" at io.platform6.core.service.tables.TablesService.renameTable(TablesService.java:604)",
" ... 7 more"
]
}
11. Test for Table update¶
Header key | Description | Value |
---|---|---|
platform6.request.action |
The action to perform (required) | table.update |
tableModel |
TableModel: JSON Table Model (required) | |
language |
language | EN or FR |
checkPermission |
boolean (Required for CMB requests) | |
scopes |
scope string (Required for CMB requests) |
A valid response will be:
Header key | Description |
---|---|
platform6.response.status |
OK |
platform6.response.value |
JSON TableModel |
If revisionId
is incorrect then it will throw an exception:
{
"message" : "io.platform6.common.http.exception.P6ResourceException: Conflict on saving the item 'raju-6'. This item has been modified by anonymous@amalto.com at Mon Feb 10 13:13:52 UTC 2025 since this item was read.",
"stackTrace" : [
"io.platform6.common.util.P6Exception: io.platform6.common.http.exception.P6ResourceException: Conflict on saving the item 'raju-6'. This item has been modified by anonymous@amalto.com at Mon Feb 10 13:13:52 UTC 2025 since this item was read.",
" at io.platform6.core.service.tables.TablesService.updateTable(TablesService.java:350)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessageTableUpdate(TablesService.java:318)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessage(TablesService.java:219)",
" at io.platform6.core.impl.servicecomponent.AbstractServiceComponent.onCommonMessage(AbstractServiceComponent.java:539)",
" at io.platform6.core.common.platform.messagebus.BusQueueController$ServiceQueueRunner.run(BusQueueController.java:146)",
" at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)",
" at java.base/java.util.concurrent.FutureTask.run(Unknown Source)",
" at java.base/java.lang.VirtualThread.run(Unknown Source)",
"Caused by: io.platform6.common.http.exception.P6ResourceException: Conflict on saving the item 'raju-6'. This item has been modified by anonymous@amalto.com at Mon Feb 10 13:13:52 UTC 2025 since this item was read.",
" at io.platform6.core.impl.servicecomponent.configuration.DAOServiceConfigurationManager.upsertItem(DAOServiceConfigurationManager.java:226)",
" at io.platform6.core.service.tables.TablesService.updateTable(TablesService.java:347)",
" ... 7 more"
]
}
If user does not have right permissions, it will throw an error:
{
"message" : "io.platform6.common.http.exception.P6ResourceException: Unauthorized: you need to have the permission tables=edit-table.",
"stackTrace" : [
"io.platform6.common.util.P6Exception: io.platform6.common.http.exception.P6ResourceException: Unauthorized: you need to have the permission tables=edit-table.",
" at io.platform6.core.service.tables.TablesService.updateTable(TablesService.java:350)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessageTableUpdate(TablesService.java:318)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessage(TablesService.java:219)",
" at io.platform6.core.impl.servicecomponent.AbstractServiceComponent.onCommonMessage(AbstractServiceComponent.java:539)",
" at io.platform6.core.common.platform.messagebus.BusQueueController$ServiceQueueRunner.run(BusQueueController.java:146)",
" at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)",
" at java.base/java.util.concurrent.FutureTask.run(Unknown Source)",
" at java.base/java.lang.VirtualThread.run(Unknown Source)",
"Caused by: io.platform6.common.http.exception.P6ResourceException: Unauthorized: you need to have the permission tables=edit-table.",
" at io.platform6.core.service.tables.utils.PermissionUtils.tablePerm(PermissionUtils.java:40)",
" at io.platform6.core.service.tables.utils.PermissionUtils.tablePerm(PermissionUtils.java:25)",
" at io.platform6.core.service.tables.TablesService.checkPermission(TablesService.java:356)",
" at io.platform6.core.service.tables.TablesService.updateTable(TablesService.java:345)",
" ... 7 more"
]
}
If keys are incorrect, it will throw an error:
{
"message" : "org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [ALTER TABLE \"td_raju_6\" DROP CONSTRAINT IF EXISTS \"td_raju_6_pkey\";ALTER TABLE \"td_raju_6\" ADD CONSTRAINT \"td_raju_6_pkey\" PRIMARY KEY (\"id1\");]; nested exception is org.postgresql.util.PSQLException: ERROR: column \"id1\" of relation \"td_raju_6\" does not exist\n Location: File: tablecmds.c, Routine: ATExecSetNotNull, Line: 7524\n Server SQLState: 42703",
"stackTrace" : [
"io.platform6.common.util.P6Exception: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [ALTER TABLE \"td_raju_6\" DROP CONSTRAINT IF EXISTS \"td_raju_6_pkey\";ALTER TABLE \"td_raju_6\" ADD CONSTRAINT \"td_raju_6_pkey\" PRIMARY KEY (\"id1\");]; nested exception is org.postgresql.util.PSQLException: ERROR: column \"id1\" of relation \"td_raju_6\" does not exist",
" Location: File: tablecmds.c, Routine: ATExecSetNotNull, Line: 7524",
" Server SQLState: 42703",
" at io.platform6.core.service.tables.TablesService.updateTable(TablesService.java:350)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessageTableUpdate(TablesService.java:318)",
" at io.platform6.core.service.tables.TablesService.notifyRequestMessage(TablesService.java:219)",
" at io.platform6.core.impl.servicecomponent.AbstractServiceComponent.onCommonMessage(AbstractServiceComponent.java:539)",
" at io.platform6.core.common.platform.messagebus.BusQueueController$ServiceQueueRunner.run(BusQueueController.java:146)",
" at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)",
" at java.base/java.util.concurrent.FutureTask.run(Unknown Source)",
" at java.base/java.lang.VirtualThread.run(Unknown Source)",
"Caused by: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [ALTER TABLE \"td_raju_6\" DROP CONSTRAINT IF EXISTS \"td_raju_6_pkey\";ALTER TABLE \"td_raju_6\" ADD CONSTRAINT \"td_raju_6_pkey\" PRIMARY KEY (\"id1\");]; nested exception is org.postgresql.util.PSQLException: ERROR: column \"id1\" of relation \"td_raju_6\" does not exist",
" Location: File: tablecmds.c, Routine: ATExecSetNotNull, Line: 7524",
" Server SQLState: 42703",
" at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101)",
" at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)",
" at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:82)",
" at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:82)",
" at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1575)",
" at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:398)",
" at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:434)",
" at io.platform6.core.service.tables.manager.SqlTableManager.executeQuery(SqlTableManager.java:331)",
" at io.platform6.core.service.tables.manager.SqlTableManager.updateTo(SqlTableManager.java:317)",
" at io.platform6.core.service.tables.TablesService.updateTable(TablesService.java:346)",
" ... 7 more",
"Caused by: org.postgresql.util.PSQLException: ERROR: column \"id1\" of relation \"td_raju_6\" does not exist",
" Location: File: tablecmds.c, Routine: ATExecSetNotNull, Line: 7524",
" Server SQLState: 42703",
" at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)",
" at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)",
" at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)",
" at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:496)",
" at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:413)",
" at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:333)",
" at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:319)",
" at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:295)",
" at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:290)",
" at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:98)",
" at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)",
" at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:425)",
" at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:383)",
" ... 11 more"
]
}
12. Test for Table delete¶
Header key | Description | Value |
---|---|---|
platform6.request.action |
The action to perform (required) | table.delete |
tableList |
List of tableModels (required) | |
language |
language | EN or FR |
checkPermission |
boolean (Required for CMB requests) | |
scopes |
scope string (Required for CMB requests) |
A valid response will be:
Header key | Description |
---|---|
platform6.response.status |
OK |
platform6.response.value |
Failed to delete the following tables list (if any) |
If user do not have permission to delete, error message will be shown
INFO [Platform6LogConfig] stdout: [headers:[platform6.response.status:true, platform6.response.value:"{sdsdfssfd-8=io.platform6.common.http.exception.P6ResourceException: Unauthorized: you need to have the permission tables=delete-table.}"], attachments:[]]