tdfs4ds.serve.code_connection¶
tdfs4ds.serve.code_connection
¶
The connection lines shared by the code the app shows (0.3.6.13).
serve/dataset_code.py (Dataset builder > Show Python) and serve/page_code.py (the (?)
icon of every page) open a session the same way: create_context with the password typed
through getpass, then connect with the read-only stores attached. A token logon
(TDFS4DS_TD_LOGDATA set) uses open_session instead. A secret never appears in the code.
Pure: no database access.
readonly_arg
¶
The databases_readonly value: names, or the three-key descriptor for a store whose
views live in another database or whose vector prefix is not the default.
connect_call
¶
tdfs4ds.connect(...) with the read-only stores when there are some. fallback is the
expression used when no store is known (the page snippets ask; Show Python keeps its marker).
standalone_prologue
¶
standalone_prologue(*, store: str, readonly, host: str, username: str, token_logon: bool, encrypt: bool = False, extra_imports=())
The lines that open the session, for a page snippet: (head, tail).
head = imports + logon + connect, ending before the try:; the page body goes inside
try: and tail (finally: tdml.remove_context()) closes it. Unknown host, user or
database are typed at the prompt (input), never left as a placeholder.