Skip to content

Commit

Permalink
new release features
Browse files Browse the repository at this point in the history
  • Loading branch information
valhuber committed Feb 1, 2025
1 parent 52d8948 commit bd115a1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
12 changes: 12 additions & 0 deletions docs/Logic-Use.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 14 additions & 1 deletion docs/WebGenAI-CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions docs/WebGenAI.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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"}

 

Expand Down

0 comments on commit bd115a1

Please sign in to comment.