Skip to content

Use -database isql parameter in create database statement [CORE5444] #5715

Open
@firebird-automations

Description

@firebird-automations

Submitted by: Konstantin Kuzvesov (kuzvesov)

Votes: 1

Now 'create database' ddl statement has the only required parameter - the specification of primary database file, while many other database creation parameters can be specified using interactive sql command line switches.

I suggest to use value of '-database' isql switch in 'create database' statement, this will reduce 'create database ...' statement in create database scripts to just 'create database;' and simplify database creation sql scripts.

To explain a bit why I made this suggestion: at this time the database creation script of an application being installed must contain database connection parameters - i.e. server, port(?), database alias - and thus the script must be either modified or created for each system the application is being installed into, or database must be created manually. I want the database creation script to stay the same for each system it is being applied to, so I want to specify database connection parameters outside of the script (at first I event took '-database' switch as the switch that allows to do what I want, because it is described as 'database name to put in script creation' in isql help).

Now:
isql-fb < create_database.sql

create_database.sql:
create database "host/port:alias" user 'sysdba' -password 'masterkey' page_size=4096 default character set utf8 collation unicode_ci_ai;
<many more other statements creating domains, tables, triggers, etc...>

In the possible future:
isql-fb -database "host/port:alias" -user 'database-creator-account' -password 'database-creator-password' < create_database.sql

create_database.sql:
create database page_size=4096 default character set utf8 collation unicode_ci_ai;
<many more other statements creating domains, tables, triggers, etc...>

I think, since any application stores database connection parameters in its configuration, the better way is to provide these parameters to database tools called rather than inject these parameters into sql scripts.

I understand that the scheme I suggest doesn't allow to specify more than the primary database file, but I think that in most cases a database consists of the only file.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions