summaryrefslogtreecommitdiff
path: root/wizards/Package_sfdatabases.mk
diff options
context:
space:
mode:
authorJean-Pierre Ledure <jp@ledure.be>2023-11-11 17:02:38 +0100
committerJean-Pierre Ledure <jp@ledure.be>2023-11-11 18:20:15 +0100
commit7b2a6f04443c5d80ce681e5f1c89bf140fdb5c3a (patch)
tree7b0a11529000b44b09c78dc6a79062773590e11e /wizards/Package_sfdatabases.mk
parentc45779ce3d1b95abd037d3d4d706aca511dfdc24 (diff)
ScriptForge (SFDatabases) new Dataset service
A dataset represents a set of tabular data stored/produced by a database. To use datasets, the database instance must exist but the Base document may not be open. A Dataset instance is create either with - the (new) database.CreateDataset() method - from an existing dataset with the (new) dataset.CreateDataset() method. The proposed API supports next main purposes: - browse for- and backward thru the dataset to get its content - update any record with new values - create new records or delete some. In summary, the AKA "CRUD" operations (create, read, update, delete). The originality of the proposed API is the use of a dense syntax to make insertions and updates easy and readable: Example: (BASIC) Dim newID As Long newID = dataset.Insert("LastName", "Doe", "FirstName", "John") ' ... is equivalent to: Dim dict As Object, newID As Long Set dict = CreateScriptService("ScriptForge.Dictionary") dict.Add("LastName", "Doe") dict.Add("FirstName", "John") newID = dataset.Insert(dict) (PYTHON) - next statements are equivalent newid = dataset.Insert('LastName', 'Doe', 'FirstName', 'John') newid = dataset.Insert({'LastName': 'Doe', 'FirstName': 'John'}) newid = dataset.Insert(dict(LastName = 'Doe', FirstName = 'John')) newid = dataset.Insert(LastName = 'Doe', FirstName = 'John') You will notice that the returned value is the AutoValue primery key (when it exists) which makes it reuse as a foreign key immediate. The API is fully available both in Basic and Python user scripts. The new service will require its inclusion in the user documentation. Change-Id: I4f834c4234e5b96ec8fddfffbad791ecf31899df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159325 Reviewed-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins
Diffstat (limited to 'wizards/Package_sfdatabases.mk')
-rw-r--r--wizards/Package_sfdatabases.mk1
1 files changed, 1 insertions, 0 deletions
diff --git a/wizards/Package_sfdatabases.mk b/wizards/Package_sfdatabases.mk
index bc5636fa1b2f..2919c84dce3c 100644
--- a/wizards/Package_sfdatabases.mk
+++ b/wizards/Package_sfdatabases.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_Package_Package,wizards_basicsrvsfdatabases,$(SRCDIR)/wizards/s
$(eval $(call gb_Package_add_files,wizards_basicsrvsfdatabases,$(LIBO_SHARE_FOLDER)/basic/SFDatabases,\
SF_Database.xba \
+ SF_Dataset.xba \
SF_Datasheet.xba \
SF_Register.xba \
__License.xba \