10.10.2017 19:00, Dimitry Sibiryakov wrote:
   Hello.

  Imagine that you are an application developer and develop an application that allow users to enter connection string for database they want to work with. Imagine that in new version of the application you would like to add some work with services (backup, restore, stats, etc.)
   What options do you have to make a string that can be used in 
isc_service_attach() call?

1) Ask user to enter host name and database name separately then combine the string 
in form <host name>:service_mgr;
2) Parse database connection string entered by user to get host name.

  First option has backward compatibility problem because in previous version of the application you asked only for whole connection string.

  I don't see it as a problem, as user already should understand what is 
connection string and
how to construct is from host name and database name. From my expirience 
"usual" applications
(such as accounting etc) already hide details about connection string from end 
users. Tools for
developers, on the contrary, allows to set connection string (among other 
params), but developers
should understand what is a host name, database name and service manager name.

  So, i see no problem here.

   Second option has forward compatibility problem because in new versions of 
Firebird format of connection string can be changed.

  I.e. users will ask you for new version of application, good for you, isn't 
is ?

   I'd suggest to offer to the application developer third, more convenient, 
option: subj.

  There is service connection and there is database connection. This is 
different things.
Your proposal hides the difference and just fools app devs.

  If database connection string is used this way, server can automatically set the database name to expected_db and dbname tags if they are not provided explicitly.

  isc_spb_expected_db was introduced for another purposes and looks like kind 
of hack for me.

  I.e. instead of "fbsvcmgr.exe localhost:service_mgr -action_nbackup -dbname test -nbk_level 0 -nbk_file file.nbk" one could use "fbsvcmgr.exe localhost:test -action_nbackup -nbk_level 0 -nbk_file file.nbk".

   Opinions?

  I see no benefits, just attempt to make a bit complex thing more complex and 
ambiguous.

Vlad

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to