#1 2024-11-12 21:43:20

vennexedu
Member
Registered: 2024-11-12
Posts: 11

Delphi Package (.dkp file)

Has anyone here tried creating a Delphi package from /src and would like to share how he did it or even share the file? I use Delphi 11.3.

Offline

#2 2024-11-13 05:30:35

TPrami
Member
Registered: 2010-07-06
Posts: 119

Re: Delphi Package (.dkp file)

Could also help if you'd shared, what kind of problems you encountered.

-tee-

Last edited by TPrami (2024-11-13 10:56:18)

Offline

#3 2024-11-13 07:10:01

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: Delphi Package (.dkp file)

I never used packages on Delphi, so I could not help much.
I remember this statement on StackOverflow: "Unless you want to use optional plugin modules, using runtime packages will almost certainly make your life much harder. – David Heffernan Commented Jan 25, 2017"
What I understand is that the mORMot core should better be in a single package, to avoid issues.

Started from https://github.com/synopse/mORMot2/issues/320
which reports issues with SQLite3 static linking, and ask for guidance when creating Delphi packages.

If anyone is already using packages, please give us some feedback here. wink

Offline

#4 2024-11-13 07:33:05

Javierus
Member
Registered: 2019-09-18
Posts: 55

Re: Delphi Package (.dkp file)

I have a big package with all the mormot2 units on it
I don't have any multithreading knowledge, and so don't know if the threadvars will work properly on a package. I suppose they will, but as I said, I can't really judge

Last edited by Javierus (2024-11-13 10:27:46)

Offline

#5 2024-11-13 10:32:51

Javierus
Member
Registered: 2019-09-18
Posts: 55

Re: Delphi Package (.dkp file)

ab wrote:

I remember this statement on StackOverflow: "Unless you want to use optional plugin modules, using runtime packages will almost certainly make your life much harder. – David Heffernan Commented Jan 25, 2017"
What I understand is that the mORMot core should better be in a single package, to avoid issues.

I've always used packages with Delphi (since D3), as I only work with one app (and ERP), and it was designed from start with the plugin idea in mind. Never had issues with packages

The only thing I don't know about are threadvars: if they are not a problem, then anything else is not a problem, and you can split mORMot2 in as many pacakges as you wish

Offline

#6 2024-11-13 10:43:44

vennexedu
Member
Registered: 2024-11-12
Posts: 11

Re: Delphi Package (.dkp file)

Javierus wrote:

I have a big package with all the mormot2 units on it
I don't have any multithreading knowledge, and so don't know if the threadvars will work properly on a package. I suppose they will, but as I said, I can't really judge

Hello Javier. Would you be so kind to share this package with me? It would really help me out a lot! I use Delphi 11.3. Don't know if that matters though.

Offline

#7 2024-11-13 11:17:11

Javierus
Member
Registered: 2019-09-18
Posts: 55

Re: Delphi Package (.dkp file)

Sure; I just made a Github GIST:
https://gist.github.com/JavierusTk/04ab … 47f7344ef8

The conditionals are the ones created by Delphi itself; I have mORMot2 repo cloned at W:\mORMot2, and my DPK stored elsewhere, so you'll need to replace my paths with yours
I've not included mormot.db.rad.nexusdb.pas, mormot.db.rad.bde.pas nor mormot.db.rad.firedac.pas, so it will not require the Delphi packages for BDE, NexusDB or FireDAC
I have Delphi Professional here, and I use UniDAC instead of FireDAC

The package has some time, so I propably have left outside a bunch of newer units, but as I don't use them, it's not a problem for me

Let me know if you have any problem

Offline

#8 2024-11-13 11:27:03

vennexedu
Member
Registered: 2024-11-12
Posts: 11

Re: Delphi Package (.dkp file)

Thanks a lot. I will try this one out. Would you care to share how you created that package so I could make my own ones as well?

Offline

#9 2024-11-13 18:12:53

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: Delphi Package (.dkp file)

My two cents: I guess that there is no "default mORMot package to fit them all".
Perhaps we may supply some packages, one without SQLite3, one with SQLite3, one with FireDac, one with UniDac, etc... but all exclusive to the other...

My question @Javierus: no specific trouble when using your package with mORMot? no trouble with RTTI?
(after looking at how packages work, my wild guess is that a monolith mORMot package could be just fine)

My question @all:
1) can anyone propose some packages?
2) could we share the same package source code between all Delphi versions?

Offline

#10 2024-11-14 21:31:35

vennexedu
Member
Registered: 2024-11-12
Posts: 11

Re: Delphi Package (.dkp file)

A little update: Installing the package worked well and now my string building and db insertion combined is about 40% faster than before! Thanks a lot!

Offline

Board footer

Powered by FluxBB