SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 09/04/2013, 07:38 PM   #1
Dan..
Gangsta
 
Join Date: Jun 2012
Location: Galati, Romania
Posts: 523
Reputation: 122
Default MySQL & PostgreSQL Plugin

MySQL & PostgreSQL Plugin

This plugin provides a set of natives used to communicate with SQL servers like MySQL and PostgreSQL. This plugin is fastest and most feature-rich plugin out yet (better than BlueG, StrickenKid, ADreNaLiNe-DJ). I'm waiting for your bug reports and suggestions. Thank you!

Building
  • Windows: Open the samp-plugin-sql.sln, choose the configuration that fits you best (Release, Release - MySQL or Release - PgSQL) and hit the `Build` button. Binaries will be located in the bin/ folder.
  • Linux: Type in terminal make MYSQL=1 (for MySQL), make PGSQL=1 (for PostgreSQL) or make MYSQL=1 PGSQL=1 (for both). Binaries will be located in the bin/ folder.

Installing
  • Move the binaries in the plugins/ folder.
    • On Windows, you probably need to copy libmysql.dll, libpq.dll and other libraries required (depending on what SQL engines are you using) in the root of the server.
    • On Linux, you probably need to copy libmysql.so, libpq.so and other libraries required (depending on what SQL engines are you using) in the root of the server.
  • Write the name of the binary at the end of the line containing plugins from server.cfg. On Linux it must contain the extension too!
  • Add the #include <sql> at the top of the script which is going to use the plugin.

Notes
  1. This plugin supports multiple connections to different or same servers, MySQL or PostgreSQL.
  2. This plugin supports both threaded and non-threaded queries, also cached and on-demand ("live", w/e) queries.
  3. This plugin's natives are very much alike with the SQLite natives. Code can be easily ported.
  4. It uses same natives for both MySQL and PostgreSQL. You can switch very easily between engines (as long as the queries are compatible.

Benchmarks
Quote:
Originally Posted by Fetch about one million rows
This plugin v2.0 - 12178 ms
BlueG's plugin R21 - 53357 ms
For downloads please check the website for anything else check the project on Github.com

Last edited by Dan..; 30/07/2013 at 05:05 PM.
Dan.. is offline   Reply With Quote
Old 09/04/2013, 07:39 PM   #2
Djole1337
Gangsta
 
Join Date: Apr 2012
Posts: 906
Reputation: 303
Default Re: MySQL Plugin v0.1 BETA

Very interesting, gonna test it.
Djole1337 is offline   Reply With Quote
Old 09/04/2013, 07:54 PM   #3
Maxips2
Huge Clucker
 
Join Date: Oct 2008
Posts: 412
Reputation: 20
Default Re: MySQL Plugin v0.1 BETA

I'm assuming this plugin doesn't support threaded queries? or that's what the callback parameter in mysql_query for?
Maxips2 is offline   Reply With Quote
Old 09/04/2013, 07:56 PM   #4
Djole1337
Gangsta
 
Join Date: Apr 2012
Posts: 906
Reputation: 303
Default Re: MySQL Plugin v0.1 BETA

Quote:
Originally Posted by Maxips2 View Post
I'm assuming this plugin doesn't support threaded queries? or that's what the callback parameter in mysql_query for?
It actually supports threaded queries.
Djole1337 is offline   Reply With Quote
Old 09/04/2013, 08:01 PM   #5
steki.
High-roller
 
steki.'s Avatar
 
Join Date: Nov 2010
Location: São Paulo, Brasil
Posts: 2,578
Reputation: 315
Default Re: MySQL Plugin v0.1 BETA

Suggestions:

- Multiple Result Sets
- Support to Stored Procedures
- NoSQL
- Prepared Statements
__________________
Rio
steki. is offline   Reply With Quote
Old 09/04/2013, 08:07 PM   #6
Dan..
Gangsta
 
Join Date: Jun 2012
Location: Galati, Romania
Posts: 523
Reputation: 122
Default Re: MySQL Plugin v0.1 BETA

Quote:
Originally Posted by Djole1337 View Post
It actually supports threaded queries.
It actually supports both threaded and non-threaded queries.

Quote:
Originally Posted by steki. View Post
Suggestions:

- Multiple Result Sets
- Support to Stored Procedures
- NoSQL
- Prepared Statements
It already supports multiple result sets! I didn't test any stored procedures, but they should work. NoSQL support is going to be added once the MySQL code of this plugin is stable. I'm working on prepared statements.
Dan.. is offline   Reply With Quote
Old 09/04/2013, 08:15 PM   #7
Maxips2
Huge Clucker
 
Join Date: Oct 2008
Posts: 412
Reputation: 20
Default Re: MySQL Plugin v0.1 BETA

Looks interesting, might switch to this in the future.
Thanks for sharing, nice work!
Maxips2 is offline   Reply With Quote
Old 09/04/2013, 08:21 PM   #8
RealCop228
Godfather
 
Join Date: Feb 2010
Location: Springboro, OH
Posts: 8,143
Reputation: 685
Default Re: MySQL Plugin v0.1 BETA

Once I see some speed tests for this plugin vs BlueG's, I'll be more interested.
RealCop228 is offline   Reply With Quote
Old 09/04/2013, 08:39 PM   #9
Dan..
Gangsta
 
Join Date: Jun 2012
Location: Galati, Romania
Posts: 523
Reputation: 122
Default Re: MySQL Plugin v0.1 BETA

Quote:
Originally Posted by RealCop228 View Post
Once I see some speed tests for this plugin vs BlueG's, I'll be more interested.
I hope I'll have enough time tomorrow to post them.
Dan.. is offline   Reply With Quote
Old 09/04/2013, 09:03 PM   #10
Kar
High-roller
 
Kar's Avatar
 
Join Date: May 2010
Location: Black Asylum
Posts: 3,277
Reputation: 429
Default Re: MySQL Plugin v0.1 BETA

so why should anyone use this over BlueG's MySQL plugin?
__________________
Kar is offline   Reply With Quote
Reply

Thread Tools
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Someone should make a PostgreSQL plugin Gamer_Z Plugin Development 19 06/02/2013 11:24 PM
PostgreSQL Steve M. Scripting Help 4 10/12/2011 11:36 AM
MySQL Plugin R5 plugin problem dud Scripting Help 12 05/12/2011 06:28 PM
[help][plugin] Can't load mysql plugin mariomako Help Archive 8 16/07/2011 02:37 PM
mysql plugin. loading plugin failed ikkentim Help Archive 2 10/02/2011 02:32 PM


All times are GMT. The time now is 11:07 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.