From bd115a11ff3957a92122e847c8a3ac4be7704560 Mon Sep 17 00:00:00 2001 From: Val Huber Date: Fri, 31 Jan 2025 20:14:22 -0800 Subject: [PATCH] new release features --- docs/Logic-Use.md | 12 ++++++++++++ docs/WebGenAI-CLI.md | 15 ++++++++++++++- docs/WebGenAI.md | 7 ++++--- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/docs/Logic-Use.md b/docs/Logic-Use.md index 7fcb64c52..9d8609689 100644 --- a/docs/Logic-Use.md +++ b/docs/Logic-Use.md @@ -212,6 +212,18 @@ Observe the `server_default` property. This value is used by LogicBank, as foll   +#### Aggregates defaulted to 0 + +Aggregate derivations (sums and counts) are defaulted to 0. + +  + +#### All Defaults + +You can set the environment variable `ALL_DEFAULTS` to force numeric values to 0, and string values to the null string. This has no effect on dates. + +  + ## Updating and Deleting These require you first obtain the row, either through a model class accessor (e.g., retrieve a parent row), or a SQLAlchemy call. In any case, alter the row as required, and issue `logic_row.update()' (or delete). As for insert, this triggers logic execution. diff --git a/docs/WebGenAI-CLI.md b/docs/WebGenAI-CLI.md index 1fea63140..13b998a54 100644 --- a/docs/WebGenAI-CLI.md +++ b/docs/WebGenAI-CLI.md @@ -197,11 +197,24 @@ The logic is non-trivial:   +#### Conditional Derivations + +You can make derivations conditional, for example: + +```html title='conditional logic' +Provide a 10% discount when buying more than 10 carbon neutral products + +The Item carbon neutral is copied from the Product carbon neutral +``` +You can find this example in the Manager Readme; see **2. New Database** > **You can iterate the logic and data model**. + +  + #### Cardinality Patterns Logic GenAI training has enabled the following: -``` +```html title='Cardinality Patterns' Products have Notices, with severity 0-5. Raise and error if product is orderable == True and there are any severity 5 Notices, or more than 3 Notices. diff --git a/docs/WebGenAI.md b/docs/WebGenAI.md index 4caba3c0c..6ef91e92f 100644 --- a/docs/WebGenAI.md +++ b/docs/WebGenAI.md @@ -31,7 +31,7 @@ Description: Instantly Create and Run Database Projects - GenAI, Flask, APIs, SQ   -> Web/GenAI is based on API Logic Server - [docs here.](Doc-Home.md){:target="_blank" rel="noopener"} +> Web/GenAI is based on API Logic Server - [docs home here.](Doc-Home.md){:target="_blank" rel="noopener"}. API Logic Server provides the CLI functions used by WebGenAI - for more on the GenAI CLI, [click here](WebGenAI-CLI.md){:target="_blank" rel="noopener"}. *Click* the image below to watch a 2 minute video: @@ -155,9 +155,10 @@ Use LogicBank to enforce the Check Credit: You can verify this by altering a sample order/item with a very high quantity, and verifying the credit limit is checked. (Note this is not trivial - 3 table transaction.) -> Note: at the time of this writing, the sample data sometimes does not totally reflect the derivation rules. This is under investigation. You can sometimes resolve this using iterations, eg, `please initialize the customer balance properly`. +For more, see -For more, see the [logic editor](WebGenAI-logic-editor.md){:target="_blank" rel="noopener"}. +* the [logic editor](WebGenAI-logic-editor.md){:target="_blank" rel="noopener"} +* [natural languge logic](WebGenAI-CLI.md#natural-language-logic){:target="_blank" rel="noopener"}