Database Utilities
- Source
Methods
(inner) clearCache(serverDatabase, nameopt)
Clears the local documents cache for the specified service.
This will force documents to be read from the server. Caution: changes to documents not saved will be lost.
Name | Type | Attributes | Description |
---|---|---|---|
serverDatabase | * | contains the server name (optional) and object service name. | |
name | string | <optional> | table/object name within the service. If no table name is specified, all documents are cleared. |
- Source
(inner) documentSave(serviceEntry, formName, formDocument) → {Promise.<boolean>}
Saves the document to the server.
Name | Type | Description |
---|---|---|
serviceEntry | * | entry for an Object Service |
formName | * | form name |
formDocument | * | form document object |
- Source
- Type:
- Promise.<boolean>
(inner) fetchAllViewDocuments(pageSize) → {Promise.<any>}
Fetch all view documents using six concurrent promises. Increases performance when reading a large number of documents from the server.
Name | Type | Default | Description |
---|---|---|---|
pageSize | * | 10 | number of document to read concurrently. |
- Source
- Type:
- Promise.<any>
(inner) getCurrentDocument() → {object}
Returns the current Form document from the local cache.
- Source
- Type:
- object
(inner) getCurrentViewDocument() → {object}
Returns the current View document from the local cache.
- Source
- Type:
- object
(inner) getDocument(formName, UNID) → {Promise.<object>}
Gets document using form name and UNID and makes it the current document. Document is loaded from server if not in local cache.
Name | Type | Description |
---|---|---|
formName | * | form name. |
UNID | * | Unique ID of the document |
- Source
- Type:
- Promise.<object>
(inner) getFormFromUNID(UNID) → {Promise.<string>}
Get form from document UNID. Only works when using online access.
Name | Type | Description |
---|---|---|
UNID | * | Unique ID of the document. |
- Source
- Type:
- Promise.<string>
(inner) getLastError(serviceEntry) → {Error}
Returns the last Error occurring in Service.
Name | Type | Description |
---|---|---|
serviceEntry | * | entry for an Object Service |
- Source
- Type:
- Error
(inner) getObjectMetadata(serviceEntry, objectName, keywords) → {Promise.<Array>}
Returns the table/object metadata.
Name | Type | Description |
---|---|---|
serviceEntry | * | entry for an Object Service |
objectName | * | table/object name |
keywords | * | [FAILSILENT] causes empty results to be returned if an error occurs |
- Source
- Type:
- Promise.<Array>
(inner) getServiceEntry(serverDatabase) → {class}
Returns the serviceEntry class for the Object Service.
Name | Type | Description |
---|---|---|
serverDatabase | * | contains the server name (optional) and object service name |
- Source
- Type:
- class
(inner) getServiceName(serverDatabase) → {string}
Returns the Object Service name contained in the serverDatabase string.
Name | Type | Description |
---|---|---|
serverDatabase | * | contains the server name (optional) and object service name |
- Source
- Type:
- string
(inner) getServiceObject(serverDatabase, name) → {any}
Returns a table/object from the Object Service.
Name | Type | Description |
---|---|---|
serverDatabase | * | contains the server name (optional) and object service name |
name | * | table/object name within the service |
- Source
- Type:
- any
(inner) setCurrentDocument(formName, UNID) → {Promise.<object>}
Sets the current document using form name and UNID.
Name | Type | Description |
---|---|---|
formName | * | form name. |
UNID | * | Unique ID of the document |
- Source
- Type:
- Promise.<object>