SA-MP Forums Archive
[Include] SQLite Improved - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] SQLite Improved (/showthread.php?tid=303682)

Pages: 1 2 3 4 5 6


Re: SQLite Improved - Slice - 07.02.2012

Whoop whoop! Minor, yet awesome update: db_get_field/db_get_field_assoc will no longer crash on NULL values!


Re: SQLite Improved - antonio112 - 07.02.2012

Woah, great work. I'll start learning SQLite from now. Keep up the good work and updates.


Re: SQLite Improved - Niko_boy - 07.02.2012

awesomnees slice


Re: SQLite Improved - Luka P. - 07.02.2012

Amazing as always, thanks!
Mirror: http://www.lpupak.com/dl/get/sqlitei.inc


Re: SQLite Improved - Slice - 09.02.2012

Update!

SQLitei has now taken a big step towards stability!

Highlights: Now these things are possible (with very little code):
pawn Код:
new uid = db_insert(db, "INSERT INTO blabla VALUES blabla");

if (uid) {
    // uid is now the index for whatever we just inserted
}
pawn Код:
printf("%d", db_query_int(db, "SELECT COUNT(*) FROM something"));



Re: SQLite Improved - TheArcher - 09.02.2012

Why don't you improve MySQL?


Re: SQLite Improved - Slice - 09.02.2012

Quote:
Originally Posted by TheArcher
Посмотреть сообщение
Why don't you improve MySQL?
The MySQL plugins are open-source, anyone can modify them where they should be - within the source code. This is not the case for SQLite, which is why I've decided to do my best in improving it.

@Steven82: Let me know if you run into problems or have any requests. Also, expect a few more updates with new features.


Re: SQLite Improved - TheArcher - 09.02.2012

Quote:
Originally Posted by Slice
Посмотреть сообщение
The MySQL plugins are open-source, anyone can modify them where they should be - within the source code. This is not the case for SQLite, which is why I've decided to do my best in improving it.
For sure you need to have C++ knowlage, isn't it?


Re: SQLite Improved - Team_PRO - 29.08.2012

Useful For Sever +rep


Re: SQLite Improved - Anonick - 29.08.2012

Quote:
Originally Posted by Slice
Посмотреть сообщение
Your script should behave exactly the same way when you include SQLite, and there won't be any significant performance changes.
What are the reasons you need this?
I use this because of the null-crash fix, and my problem was that my script was spamming auto-release when I always release manually.
"The result being freed was inside the autorelease pool"
I disabled it now though.


Re: SQLite Improved - Slice - 29.08.2012

Ah, ok, well you could add "false" at the end of your db_query calls to disable autofreeing.


Re: SQLite Improved - RedJohn - 08.09.2012

Is there any tutorial on Login & Register using this include?


Re: SQLite Improved - Slice - 08.09.2012

Yeah, there's a demo somewhere in this topic.


Re: SQLite Improved - ViruZz - 10.09.2012

Not bad, might update the LV-RP SQLite GM to this.


Re: SQLite Improved - Memoryz - 14.09.2012

Slice, how can I do this:

pawn Код:
new uid, DBStatement:stmt = db_prepare(trpdb, "SELECT uid FROM users WHERE name=? LIMIT 1");
And then num_rows this? Since it's a prepared statement and I can't see that it would work with "db_num_rows(DBResult:dbresult)" since there is no result in stmt_execute?

So how can I check the number of rows after a prepared statement?


Re: SQLite Improved - Slice - 14.09.2012

Use stmt_rows_left.


Re: SQLite Improved - Memoryz - 22.09.2012

pawn Код:
db_last_insert_rowid(DB:db)
]

Crashes the server after doing prepared statement:

pawn Код:
"INSERT INTO staticphones (x,y,z,rz,int,vw,type) VALUES(?,?,?,?,?,?,1)"



Re: SQLite Improved - Slice - 23.09.2012

Hm.. Linux or Windows? As a temporary solution, use db_query_int(db, "SELECT last_insert_rowid()").


Re: SQLite Improved - ReVo_ - 20.04.2013

Your test code cause a crash on linux

Quote:

[07:24:18] [debug] Server crashed while executing timertest.amx
[07:24:18] [debug] AMX backtrace:
[07:24:18] [debug] #0 00005530 in booltmt_fetch_row (&DBStatementtStatement=@0x00056c90) at [...]\include\sqlitei.inc:1724
[07:24:18] [debug] #1 0000a29c in public OnGameModeInit () at [...]\timertest.pwn:88
[07:24:18] [debug] System backtrace:
[07:24:18] [debug] #0 f71dbecb in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[07:24:18] [debug] #1 f71d3c69 in _ZN11CrashDetect20PrintSystemBacktraceEPv () from plugins/crashdetect.so
[07:24:18] [debug] #2 f71d5c99 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[07:24:18] [debug] #3 f71db9d8 in ?? () from plugins/crashdetect.so
[07:24:18] [debug] #4 ffffe600 in ?? ()
[07:24:18] [debug] #5 f71df3b6 in amx_Exec () from plugins/crashdetect.so
[07:24:18] [debug] #6 f71d5e1e in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[07:24:18] [debug] #7 f71d82de in ?? () from plugins/crashdetect.so
[07:24:18] [debug] #8 080acc4b in ?? () from ./samp03svr
[07:24:18] [debug] #9 080b2b3d in ?? () from ./samp03svr
[07:24:18] [debug] #10 080b1407 in ?? () from ./samp03svr
[07:24:18] [debug] #11 004d6ebc in __libc_start_main () from /lib/libc.so.6
[07:24:18] [debug] #12 0804b521 in ?? () from ./samp03svr




Re: SQLite Improved - Slice - 20.04.2013

Which test code?