Return Metadata for a Table
/mobile/system/databaseManagement/tables/{table}
Returns metadata describing the specified table in the environment's database schema.
Note: When you use the Database Access operations to work with the table data, you'll need to know the order of the primary keys that you used when you created (or re-created) the table. However, when you call either GET /mobile/system/databaseManagement/tables
or GET /mobile/system/databaseManagement/tables/{table}
, the primaryKeys
property lists the columns in alphabetical order, and not in the order that you used when you created or re-created the table. Therefore, you must make a note of the order when you create or re-create a table.
Permissions
Only team members with the Mobile_DbMgmt
role can access the Database Management API.
Request
-
table: string
The name of the table.
Response
- application/json
200 Response
Table metadata
object
-
object tableInfo
Database table metadata
-
object tableInfoRead-allOf[1]
object
-
columns:
array columns
Minimum Number of Items:
0
The database table columns. -
name:
string
The table name. This attribute is case sensitive. There are database restrictions on the maximum length of the name and which special characters are allowed. However, because the names are within double quotation marks, you can use spaces and some special characters.
-
primaryKeys:
array primaryKeys
Minimum Number of Items:
0
The columns to use for the primary keys. Note that when you use the Database Access operations to work with the table data, you'll need to know the order of the primary keys that you used when you created (or re-created) the table. However, when you call either `GET /mobile/system/databaseManagement/tables` or `GET /mobile/system/databaseManagement/tables/{table}`, the `primaryKeys` property lists the columns in alphabetical order, and not in the order that you used when you created or re-created the table. Therefore, you must make a note of the order when you create or re-create a table. -
requiredColumns(optional):
array requiredColumns
Minimum Number of Items:
0
The columns that must be set with non-null values. These columns are created with the `NOT NULL` constraint.
object
-
indexes(optional):
array indexes
Minimum Number of Items:
0
The database table indexes.
array
0
-
Array of:
object columnInfo
Database column metadata.
array
0
array
0
object
-
name:
string
The column name.
-
size(optional):
integer
For `string`, `integer`, and `decimal` columns, the size or precision of the column. String values can't exceed 4000 characters. Unless you have a valid business constraint, you should not specify size and subsize for integers and decimals because this limits which values are acceptable and makes it hard to resize the column. When possible, allow the database to size and store the value as efficiently as possible.
-
subSize(optional):
integer
For `decimal` columns, the scale of the column, meaning the number of places after the decimal point.
-
type:
Allowed Values:
[ "string", "dateTime", "integer", "decimal", "boolean" ]
The column type. `dateTime` is a string in ISO date and time format (for example, `2015-03-21T17:00:00.000-08:00`).
array
0
-
Array of:
object index
The table index metadata.
object
-
columns:
array indexColumns
Minimum Number of Items:
1
Unique Items Required:true
The indexed columns. -
name:
string
The index name.
array
1
true
Examples
The following example shows how to get the description of a database table by submitting a GET request on the REST resource using cURL. This request gets the description of the Movies
database table. For more information about cURL, see Use cURL.
curl -i -X GET -u username:password -H "Oracle-Mobile-Backend-ID: ABCD9278-091f-41aa-9cb2-184bd0586fce" https://fif.cloud.oracle.com/mobile/system/databaseManagement/tables/Movies
Example of Response Header
The following shows an example of the response header:
200 OK Content-Type: application/json Date: Mon, 29 Jan 2018 00:32:52 GMT
Example of Response Body
The following example shows, in JSON format, the contents of the response body, which lists the metadata for the database table:
{
"name": "Movies",
"primaryKeys": [
"title"
],
"requiredColumns": [
"title",
"releaseDate"
],
"columns": [
{
"name": "title",
"size": 50,
"type": "string"
},
{
"name": "synopsis",
"size": 4000,
"type": "string"
},
{
"name": "inTheaters",
"type": "boolean"
},
{
"name": "releaseDate",
"type": "dateTime"
},
{
"name": "runningTime",
"size": 3,
"type": "integer"
},
{
"name": "poster",
"type": "binary"
},
{
"name": "totalGross",
"size": 10,
"subSize": 2,
"type": "decimal"
},
{
"name": "createdBy",
"size": 80,
"type": "string"
},
{
"name": "createdOn",
"type": "dateTime"
},
{
"name": "modifiedBy",
"size": 80,
"type": "string"
},
{
"name": "modifiedOn",
"type": "dateTime"
}
],
"indexes": [
{
"name": "Movies_pk",
"columns": [
"title"
]
}
]
}