9

I am wondering if we able to embed SQlite library into Delphi executable file and we may deploy our application as single .exe file without any SQlite dll file.

The embed is not keep the sqlite dll file into resource but link to Delphi executable file.

1
  • The Aducom wrapper appears to be what you are looking for. Commented May 20, 2011 at 10:37

6 Answers 6

6

I have not tried this component out, but I plan to in the future Delphi Inspiration - DISQLite3

There is also Synopse OpenSource SQLite3 Framework

A Freeware version is available too

Sign up to request clarification or add additional context in comments.

1 Comment

Our SQLite3 dedicated classes can now be easily used outside the scope of our ORM framework. They can also be replaced by another database engine, if needed (via OleDB or direct Oracle access).
5

We have compiled SQLite3 with Borland's free command line tools C compiler and the resulting OBJ file we linked in Delphi with {$LINK 'OBJS\sqlite3.obj'}, and written the pascal wrappers for the functions we needed.

There was a problem resolving some standard C library functions when linking but we re-implemented them in Delphi.

1 Comment

This is exactly what we did with our Open Source binding of SQLite3. So you have all the source code at hand - especially the standard C library equivalencies in pure Delphi code (this is not so obvious).
4

I had the same problem and this is the solution I came up with. Maybe it can help you. Just include sqlite3 and you then have direct access to the dll functions. I used the same methods that have already be outlined: http://simvector.com/download/delphi_sqlite3.zip

The DLL is just encoded in source form and the DLLLoader unit loads it at runtime. The end result is no extra DLL in your distro at the expense of it all being loaded into memory at once vs parts loaded on demand via the OS.

We needed it to work as normal, yet no extra dll in distro. So works for our needs.

6 Comments

This seems to be an interesting solution. I think it is a favor solution over DISqlite
Yea I've been using this method in my code base for some time now and it has worked out well.
I think keep the sqlite dll into resource and load into the the dll loader should be the way to go. I never know we may load the dll from memory stream. Thanks for showing me the example.
I just found this site: synopse.info/fossil/wiki?name=SQLite3+Framework from what I can tell, I think it's been translated to Delphi. If so then we no longer have to go through these extra hoops.
The original zip file is no longer online. There is a guide on how to load a DLL from a resource into a TMemoryStream and then use it directly without writing it to disk: delphi.about.com/od/windowsshellapi/a/…
|
4

Anydac SQLite driver has statically linked SQLite engine. It is commercial library, although. They has an article about anydac and sqlite.

Comments

1

Delphi can link .obj files, thereby if you have them available (or source code to compile them), you can link them into an executable. But you can't to that with the SQLLite dll.

IIRC DISQLite 3 does exactly that, check it.

1 Comment

Very easy to say, but often very hard to do. You typically need to supply the C runtime functions too and for a large library that can be a devil of a job. Plus you have to deal with strange ordering issues when linking the .obj files: stackoverflow.com/questions/4638186/…
0

You can download the SQLite open source and compile it into any environment that can compile vanilla C code. It's not especially hard.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.