Feature #8834
add bootstrap configuration support for -db OE command line parameter (and related database parameters)
0%
Related issues
History
#1 Updated by Greg Shah about 1 month ago
The current code provides two ways to make a database connection in FWD:
- Using the session based auto-connect (#3930) that is configured in the directory.
- Executing a
CONNECT
statement in 4GL code.
The auto-connect is a weird replacement in FWD for the -db
command line parameter which is how it is done in OE. That might be specified in a .pf
file or explicitly on the command line, but using -db
(and the implicit "special" database name as first parameter of a command) is the way that OE allows a database to be connected for a session. This mechanism has the advantage over the CONNECT
statement because it enables all 4GL programs (including the startup procedure) to access the database.
It is also nice because it allows customization of which database instance will be connected, where the FWD directory auto-connect is not as flexible. So the intention here is to add support in bootstrap configuration for connecting databases. When we add this support, it should support the same options that we support in the CONNECT
statement. This might be things like hostname, port/servicename and so forth.
One thing that makes this less straightforward to implement is that in the 4GL, you can have many -db
sections on the command line (each section can have it own related parameters like -db some-database.db -H host -S port -ssl -P password
. In this example, the -H host
is an option that relates to the -db some-database.db
. In addition, there can be more than one -db
and each of them can have their own database parameters. So there can be more than one -H
too. The current bootstrap cfg approach doesn't provide for arrays at the key
level, so we either need to add such a concept or do something dirty like adding a numeric suffix to these and honoring n
number of these. Yuck, I don't that.
#2 Updated by Greg Shah about 1 month ago
- Related to Feature #3930: allow session level control over the database(s) which are auto-connected added
#3 Updated by Galya B about 1 month ago
Are -H
, -S
and -P
used only for the db? If so, it's best to have an array of custom objects with all the configured details for the db instead of having its properties spread out as separate params.
Also I've found an interesting behavior of -pf
we don't seem to support (https://docs.progress.com/bundle/abl-reference/page/STARTUP-PARAMETERS-attribute.html): In the character response of the getter SESSION:STARTUP-PARAMETERS
pf should be presented as -pf dbconnect.pf,-db sports2020,-H pclsmith,-S 5000,(end .pf)
, in other words its content should be read on startup and saved in a more complex structure instead of a string.
If all dbs should be auto-connected simultaneously, then I guess precedence is not that important. Nevertheless, it may need to be tested for conflicting settings.