Metadata-Version: 2.4
Name: oliviadb-dli
Version: 0.1.3
Summary: DL/I calls from Python on OliviaDB: schedule programs on DBD/PSB definitions and make GU, GN, ISRT, REPL, DLET and the other calls
License-Expression: Apache-2.0 AND (AGPL-3.0-only OR LicenseRef-OliviaDB-Commercial)
Project-URL: Homepage, https://olivia-db.com/
Project-URL: Documentation, https://docs.olivia-db.com/dli-quickstart/
Project-URL: Source, https://github.com/OliviaDB/oliviadb-python
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSE-native.md
License-File: NOTICE-native.md
License-File: THIRD_PARTY-native.md
Dynamic: license-file

<!-- SPDX-License-Identifier: Apache-2.0 -->
# oliviadb-dli

DL/I calls from Python on OliviaDB: open a store, import DBDGEN and PSBGEN source, schedule a
program on a PSB and make its calls (GU, GN, GNP, the hold forms, ISRT, REPL, DLET and the system
service calls) with I/O areas and segment search arguments, as an IMS program does through its PCBs.

```python
from oliviadb_dli import Library, Runtime, Ssa

with Library.load().open("store") as system:
    system.load_library("dli")  # PARTDB.dbd, PARTPSB.psb
    prog = system.schedule("PARTPSB", Runtime.ASCII_BE)
    io = bytearray(prog.io_size(1))
    status = prog.call(1, "GU", io, [Ssa("PART").qual("PARTNO", "=", b"P00001").build()])
    print(status, bytes(io), prog.pcb(1).key_feedback)
    prog.terminate()  # commit; abort() backs out
```

## Through a server (client mode)

With OliviaDB 0.1.1 (C ABI 14) a program can run its calls in an `oliviadb-server` that holds the
store, beside other programs and network clients, isolated from them by the server's locks:

```python
system = Library.load().connect("dli.example.com:7655", key=api_key, ca_file="ca.pem")
system.load_library("dli")  # checked against the server's library
prog = system.schedule("PARTPSB", Runtime.ASCII_BE)
# calls as above; a lost connection raises LostError, then system.outcome() for the last commit point
```

`Library.open` binds to a server too when `OLIVIADB_DLI_SERVER` is set (`unix:/path` for a socket
on the server's host). See <https://docs.olivia-db.com/> ("DL/I programs").

## Licence

The Python code is Apache-2.0. The wheels for Linux (x86_64, aarch64) and macOS (arm64, x86_64)
also contain OliviaDB's DL/I library `liboliviadb_dli`, which is licensed under AGPL-3.0-only or
OliviaDB's commercial licence. A wheel as a whole is therefore
`Apache-2.0 AND (AGPL-3.0-only OR LicenseRef-OliviaDB-Commercial)`: using it is using the
AGPL-licensed library, unless you have OliviaDB's commercial licence. The source distribution
contains no library.

## The library

Loaded from the file `OLIVIADB_DLI_LIB` names, else the wheel's copy, else the system's library
search path. It needs C ABI version 13 or later (OliviaDB 0.1.0); client mode needs 14 (OliviaDB 0.1.1).

## Character sets

`Program.call` and `Ssa` write names, function codes and operators in ASCII, for programs
scheduled with `Runtime.ASCII_BE` or `Runtime.ASCII_LE`. A program scheduled with
`Runtime.EBCDIC` makes its calls with `Program.call_bytes` and SSAs in EBCDIC bytes of its own.
