[SOLVED] Databases / Dealing with lots of data

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
PiFace
Prole
Posts: 28
Joined: Mon Sep 05, 2016 5:35 pm
Location: Brazil

Re: [SOLVED] Databases / Dealing with lots of data

Post by PiFace »

zorg wrote:The karma system is long gone, hence why it was crossed out in the forum rules.
Oh, I see.
zorg wrote: Also:

Code: Select all

if type(values[i]) == 'number' then
Then again, comparisons like that may be more costly because of branching than calling tonumber on all elements... not sure though, would need to benchmark to see.
That's probably going to affect only game loading, right? uh... anyway, when I finish registering ALL entries I'll return to this issue and check if performance was hurt along the way. Thank you for pointing that out.

raidho36 wrote:At this point I'm just talking out of my ass here because this library is nothing like I expect it would be like. It uses callbacks yet it's not async? It outputs numerical values as strings? I don't know what the hell is wrong with that thing.
LOL me neither! But the 'number as strings' thing is perhaps a problem with my database schema. I tested this:

Code: Select all

CREATE TABLE [base] (
  [id] number, 
(other columns below...)
  
but it still returned as strings, I don't know why. But overall, I'm happy it worked in the end haha thank you all!
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: [SOLVED] Databases / Dealing with lots of data

Post by airstruck »

raidho36 wrote:At this point I'm just talking out of my ass here because this library is nothing like I expect it would be like. It uses callbacks yet it's not async? It outputs numerical values as strings? I don't know what the hell is wrong with that thing.
It is supposed to be asynchronous (at least sometimes), otherwise stuff like db:interrupt and db:progress_handler wouldn't make any sense. Although, it does seem to do stuff immediately sometimes, for example with a fast query if you print the return code from exec and print something from within the callback, the callback prints can show up first.

SQLite uses dynamic typing, so column types are more like "suggestions," they're not actually required or enforced. They should be used for things like trying to return the values in the desired format, probably, so that's more of an issue with the driver.

https://www.sqlite.org/faq.html#q3
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 2 guests