On 3-8-2011 12:05, Tony Whyman wrote:
> Actually, my preference for creating a database in a deployed
> application is to first create it on my local system using isql with
> input from a  script and then to save it using gbak in a portable
> format. The TIBRestoreService is then used to create the database from
> the backup archive when your program fails to detect a local database copy.
> 
> The advantages of this approach are that:
> 
> - you only ever have one file to distribute
> 
> - backup/restore is very robust and quick
> 
> - you can readily add Blob data to your archive and distribute it as
> part of the archive
> 
> - the initial database is consistent across all deployments
> 
> Scripts tend to be more useful when issuing patches to existing
> databases. In this case, simply calling isql from your program and
> pointing it at a patch script can be much easier than embedding SQL
> execution in your program.
> 

I understand your approach - and I suspect you have a lot more
experience with Firebird deployments than I.

As for the scripts, yes, I agree that's a good idea for patching, but it
would be nice if you could use SQLDB's SQLScript for that (haven't tried
it yet). This cuts down on the number of external files you have to
distribute.

I needed to create a db in code because I was writing a sample Lazarus
application to show how to use SQLDB with embedded Firebird:
http://lazarus.freepascal.org/index.php/topic,10811.msg74279.html#msg74279

Having people download and run isql just to set up the database seemed
inelegant, error prone and time consuming.
Of course, I could have used IBX components, but then people would have
to download & install those....

Thanks for your insights,

Reinier
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to