Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-04-2009, 10:08 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
SQL Explorer

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:
  • Create, drop, duplicate, and rename whole tables
  • Create and drop indexes on tables
  • Insert rows into tables
  • Duplicate rows in tables
  • Modify rows in tables
  • Delete rows in tables
  • Automatic pagination for table viewing
  • "Execute SQL" tab that allows you to test and run SQL queries and view data in more advanced, customized ways
  • Tables can be sorted directly from the table view by double clicking the column; double click again to toggle between ascending and descending.
  • Filter tables directly from the table view using modes such as "=", "LIKE", and "contains".
  • Work easily between multiple databases
  • Beautiful interface for everything

Screenshots:
Click image for larger version

Name:	graal_1254685069.png
Views:	710
Size:	34.6 KB
ID:	49542 Click image for larger version

Name:	graal_1254685131.png
Views:	604
Size:	17.2 KB
ID:	49543 Click image for larger version

Name:	graal_1254685155.png
Views:	520
Size:	6.2 KB
ID:	49544Click image for larger version

Name:	graal_1254685176.png
Views:	824
Size:	37.9 KB
ID:	49545 Click image for larger version

Name:	graal_1254685785.png
Views:	486
Size:	9.5 KB
ID:	49546 Click image for larger version

Name:	graal_1254685827.png
Views:	600
Size:	23.7 KB
ID:	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:
  • fowlplay4 for his SQL Worksheet, after which much of the "Execute SQL" tab was modeled, and for his number formatter.
  • Inverness for putting up with my whiny questions about SQL
  • The artists behind the graphics on the database tab. Credits are available at these links: 1 2 3

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.

Last edited by Tigairius; 07-23-2011 at 06:24 AM.. Reason: Updating information
Reply With Quote
  #2  
Old 10-04-2009, 10:12 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
awsome work chris! rep++!
(got to spread it first Z_z)
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #3  
Old 10-04-2009, 10:23 PM
Matt Matt is offline
iZone Administrator
Matt's Avatar
Join Date: Apr 2005
Location: United States
Posts: 2,690
Matt is a jewel in the roughMatt is a jewel in the rough
Very nice work.
__________________
Need Playerworld or Account support?
GraalOnline/Toonslab Support Center
Reply With Quote
  #4  
Old 10-04-2009, 10:27 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Very nice, will definitely manipulate my own tables with it.
__________________
Quote:
Reply With Quote
  #5  
Old 10-05-2009, 12:36 AM
Seich Seich is offline
Noctorious' NeoHunter
Seich's Avatar
Join Date: Jun 2008
Location: Honduras
Posts: 193
Seich will become famous soon enough
Send a message via MSN to Seich Send a message via Yahoo to Seich
Woah that's awesome.. =O, I'll be using this a lot.
Reply With Quote
  #6  
Old 10-05-2009, 12:42 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
This is some real quality work!
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #7  
Old 10-10-2009, 04:42 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
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).
__________________
Reply With Quote
  #8  
Old 10-10-2009, 05:01 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
This probably deserves a sticky.
Reply With Quote
  #9  
Old 10-10-2009, 05:08 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by cbk1994 View Post
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).
Interesting way to store rights for scripts, will remember that.
__________________
Quote:
Reply With Quote
  #10  
Old 12-09-2009, 04:15 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
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:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #11  
Old 12-10-2009, 12:16 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by coreys View Post
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.
You can use "PRIMARY KEY", but it will just be an alias for the rowid column.

EDIT: See this page as well.
__________________
Reply With Quote
  #12  
Old 12-10-2009, 01:12 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by cbk1994 View Post
You can use "PRIMARY KEY", but it will just be an alias for the rowid column.

EDIT: See this page as well.
I know, but I'm saying that when attempting to use the option when creating a column through the GUI it gives an error.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #13  
Old 12-10-2009, 02:04 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by coreys View Post
I know, but I'm saying that when attempting to use the option when creating a column through the GUI it gives an error.
That's probably my fault, I'll add that to my list of improvements.
__________________
Reply With Quote
  #14  
Old 12-10-2009, 02:49 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by cbk1994 View Post
That's probably my fault, I'll add that to my list of improvements.
That's gotta be a short list <3
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #15  
Old 12-10-2009, 03:13 AM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.