Page 2 of 2

Re: PureBasic SQLite Database: A Quick Tutorial

Posted: Tue Aug 13, 2024 6:52 am
by TI-994A
jacdelad wrote: Mon Aug 12, 2024 5:24 pm This would a great addition to the help.
Thanks for your kind endorsement, jacdelad. :D

Or at the very least a sticky, perhaps. :lol:

+1

Re: PureBasic SQLite Database: A Quick Tutorial

Posted: Tue Aug 13, 2024 10:39 am
by Kiffi
TI-994A wrote: Tue Aug 13, 2024 6:52 amOr at the very least a sticky, perhaps.
[X] Done

Re: PureBasic SQLite Database: A Quick Tutorial

Posted: Tue Aug 13, 2024 11:24 am
by TI-994A
Kiffi wrote: Tue Aug 13, 2024 10:39 am
TI-994A wrote: Tue Aug 13, 2024 6:52 amOr at the very least a sticky, perhaps.
[X] Done
Hi Kiffi. In all honesty, I was simply jesting. :lol:

Nevertheless, I'm glad it's helpful. Thank you, kindly. :D

Re: PureBasic SQLite Database: A Quick Tutorial

Posted: Tue Aug 13, 2024 12:09 pm
by Fred
Your second topic at the top :D. Well deserved !

Re: PureBasic SQLite Database: A Quick Tutorial

Posted: Tue Aug 13, 2024 12:28 pm
by jacdelad
It is well written and touches all the basics. The only thing that could be added, at least in my eyes, is how to use a database which is not written to a file, but into memory (for temporary usage).

Re: PureBasic SQLite Database: A Quick Tutorial

Posted: Wed Aug 14, 2024 12:14 pm
by TI-994A
Fred wrote: Tue Aug 13, 2024 12:09 pmYour second topic at the top :D. Well deserved !
jacdelad wrote: Tue Aug 13, 2024 12:28 pmIt is well written and touches all the basics. ...
Very kind words, both of you. I'm truly obliged. :D

Re: PureBasic SQLite Database: A Quick Tutorial

Posted: Thu Aug 15, 2024 11:12 am
by TI-994A
jacdelad wrote: Tue Aug 13, 2024 12:28 pm...how to use a database which is not written to a file, but into memory (for temporary usage).
Hi jacdelad. An in-memory database works exactly like a normal file-based one. The only difference is, like you said, it's temporary. All the processed data will be lost when the program terminates unless it's saved to file.

To use an in-memory database, simply replace the database file name with the :memory: directive - that's all! Everything else works exactly the same way.

Code: Select all

OpenDatabase(#sqLite, ":memory:", "", "")

Here's a simple, working example which I had posted a few years ago, demonstrating an in-memory database in action:

> In-Memory SQLite Example

I hope it's helpful. :D

Re: PureBasic SQLite Database: A Quick Tutorial

Posted: Thu Aug 15, 2024 1:32 pm
by Fangbeast
Good stuff TI-994A, nicely done examples.

Re: PureBasic SQLite Database: A Quick Tutorial

Posted: Thu Aug 15, 2024 2:41 pm
by TI-994A
Fangbeast wrote: Thu Aug 15, 2024 1:32 pm Good stuff TI-994A, nicely done examples.
Hi Miki. Trust you are well, dear friend.

I'm glad you think so; thank you. Just sharing all that I've learned here. :D

Re: PureBasic SQLite Database: A Quick Tutorial

Posted: Thu Aug 15, 2024 3:09 pm
by jacdelad
TI-994A wrote: Thu Aug 15, 2024 11:12 am
jacdelad wrote: Tue Aug 13, 2024 12:28 pm...how to use a database which is not written to a file, but into memory (for temporary usage).
Hi jacdelad. An in-memory database works exactly like a normal file-based one. The only difference is, like you said, it's temporary. All the processed data will be lost when the program terminates unless it's saved to file.

To use an in-memory database, simply replace the database file name with the :memory: directive - that's all! Everything else works exactly the same way.

Code: Select all

OpenDatabase(#sqLite, ":memory:", "", "")

Here's a simple, working example which I had posted a few years ago, demonstrating an in-memory database in action:

> In-Memory SQLite Example

I hope it's helpful. :D
Hi TI-994A,
I already knew that. :wink: I just thought this would be a great addendum to your tutorial, like a last chapter with some tipps and tricks.

Re: PureBasic SQLite Database: A Quick Tutorial

Posted: Fri Aug 16, 2024 11:40 am
by TI-994A
jacdelad wrote: Thu Aug 15, 2024 3:09 pm... I just thought this would be a great addendum to your tutorial, like a last chapter with some tipps and tricks.
That makes more sense. Great suggestion! Thank you, jacdelad.

Done! :D