![]() |
SQL Explorer
6 Attachment(s)
I present to you SQL Explorer, an in-game SQL database manager for Graal.
For those of you who aren't familiar, SQLite is a "software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine". Basically, it's a really fast and efficient way to store data into tables. Data can range from logs to bank accounts to sparring stats. SQL Explorer is a multipurpose tool that makes it easy to view and manage all of this data. Current Version: 2.2 Features:
Screenshots: Attachment 49542 Attachment 49543 Attachment 49544Attachment 49545 Attachment 49546 Attachment 49547 Instructions: Upload to your server into a weapon script, add it to yourself, and press "n". If you want the databases tab to be fully functional, add r databases/*.db to the rights of (npcserver). Note: Until a way is found/added to dynamically get a list of configured SQLite databases, you will have to put them into the script manually. The function, getDatabaseList(), is at the very top of the script. It should be pretty self-explanatory how to add them. Thanks to:
Disclaimer: This is a tool for developers. It's not something that is completely bulletproof with security. In other words, if you're trying to mess something up or cause some kind of error, you probably can. It doesn't necessarily protect against SQL injection in all cases, so just be careful with what you do. See also: SQLite Database Browser - an external tool for viewing the database; it can be used in any instance where my tool fails for whatever reason If you find any bugs/glitches, please report them; I use this tool on a daily basis, and any bugs you have will eventually effect me too. Comments, criticism, and suggestions are also welcome. The latest version of SQL Explorer can always be found here. |
awsome work chris! rep++!
(got to spread it first Z_z) |
Very nice work. ^^
|
Very nice, will definitely manipulate my own tables with it. :D
|
Woah that's awesome.. =O, I'll be using this a lot.
|
This is some real quality work! :)
|
Updated to version 1.1 (thanks Tig); it contains a rights system (which can be enabled or disabled). See the first post for a description of how to use it (or disable it -- it's enabled by default).
|
This probably deserves a sticky.
|
Quote:
|
Are auto-incrementing constraints not available in the GS2 wrapper for sqlite? Because this tool reports an error any time I try to create a column with auto-increment set.
Edit: This is just an observation due to the auto-increment option in the SQL Explorer, I don't actually need to make use of it since SQLite has an auto-incrementing ROWID set by default. |
Quote:
EDIT: See this page as well. |
Quote:
|
Quote:
|
Quote:
|
Although it could easily be done under the "Execute Query" tab, searching would be a nice thing to add for when users are viewing a table.
Also sorting by column wouldn't be that hard to do, either. If you click a column header, it will sort the rows by that column...click it again and it will sort them in the opposite direction. |
A query generator would be cool too.
I.e: Select a few columns from a few tables, and so on.. click Generate Query. PHP Code:
|
NPCserver update: the next uploaded npcserver will include a new script command bool sqlitedefragment(host) for defragmenting and reducing the file size (host=="" for default database). May be there could a file panel or so where you see the database size and a button for optimizing it.
|
Just seeing the database size would be very useful. Nice addition to hear of, though, Stefan :)
|
Sorry for the double post. There seem to be SQL errors every now and then, such as this:
Quote:
|
All good ideas, I'll try to update it over the weekend. Stefan: is there any advantage to the scripted functions as opposed to just calling "VACUUM"?
Quote:
Quote:
|
I've added quite a few things to the new version, mostly bug fixes, but also some other stuff. I went to add the database information, but ran into a wall: ".db" isn't one of the extensions the NPC-server can manipulate, which means I can't read the file size. I mentioned this to Stefan a few weeks or so again, so he may have fixed it in the new NPC-server, but I'm not sure. Until then, I'll leave it out (psst Stefan, would be great if you could fix it and let me know).
|
Quote:
|
Quote:
|
Sorry for the delay, updated to version 2.0; see first post (thanks again Tig) :)
Changelog:
I'll release an updated version with database statistics when the new NPC-server is released. Filter: http://img6.imageshack.us/img6/3858/filterq.png Sort: http://img96.imageshack.us/img96/4240/chatlogs.png |
Nice, you implemented my suggestions. :D
|
This is great. Well done, Chris. Rep++
|
2 Attachment(s)
Updated to version 2.1, thanks Supernanny. Here are some of the changes:
Mostly minor improvements besides the change for multiple databases. Right now there's no way to dynamically get a list of configured databases, so you will have to maintain the list yourself. There's a list with the default configuration near the top of the script. Add any additional databases there and you'll be good to go. The file of the database isn't used yet but will be in the future (probably). |
Fantastic job, nice seeing things updated.
|
This is an excellent tool.
|
Hmm, I seem to be having some problems deleting a row from a table, I used the exact same code as you have posted but it seems to not find the table correctly... any suggestions?
|
Quote:
|
Quote:
I don't know if it was intentional or not, but with the newer version it doesn't update the list every time you make a change. I had the same problem thinking it wasn't deleting rows properly but closing the tabs, refreshing, and then reopening showed me that the row was actually deleted. Edit: Hmm, I just tested and I'm actually having the same problem. Refreshing doesn't help, and the row is not deleted via right-click delete! |
1 Attachment(s)
Sorry about that, I've attached a fixed version and I'll get the first post updated soon.
The only changes are the fixes for duplicating and deleting rows. |
Ah, so it's not just me *phew
thanks @ Chris, I thought I'd done something wrong It's an amazing tool, I'd rep+++++++++++++++++++++++++ infinity!! Works a charm- lovely thank you :) |
External GUIs look so ugly. >_<
But nice update. |
I'm releasing version 2.2 of SQL Explorer (thanks Tig for updating the original post).
http://uploads.graalcenter.org/uploa...44.02%20PM.png New Features:
Bugfixes:
Warnings to Upgraders: The rights system has been removed. SQL Explorer is not meant to be given out as a staff right, which is what the former system was promoting. Now, access is limited to those in staff= in server options and who have the NPC-Control right. The latter can be disabled near the top of the script, but I don't recommend it. SQL Explorer is no longer tested with Graal v5. If you're still using it, you should consider switching to v6. Images for the databases tab are downloaded from the Wiki if you don't already have them. This means that, in theory, Stefan could tell when you open SQL Explorer and don't have the images downloaded. If for some reason you want to hide from him, you can download the images yourself and place them in your images folder. You can find the new version of SQL Explorer here. As always, suggestions and bug reports are welcome :). |
Excellent.
|
Good stuff :)
|
very nice! rep+
|
This is amazing =o
rep++ |
| All times are GMT +2. The time now is 10:41 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.