Require module sqlite
How do you require module sqlite? I know there that if you include something it automatically loads module, but why isn't working for sqlite? It gives me error(when Sqlite isn't enabled in modules) that I can't connect to DB. When I enable it in modules.ini it works fine.
|
Re: Require module sqlite
Try
#pragma reqclass sqlite or #pragma defclasslib sqlite |
Re: Require module sqlite
With #pragma reqclass sqlite I get this:
Quote:
With #pragma defclasslib sqlite I can't compile: Quote:
|
Re: Require module sqlite
sqlite is a special case. Both mysql and sqlite uses "dbi" as library name, to keep compatibility with old natives as well.
They share also the same natives names and basically the same base. Because of you can choose dynamically the driver with SQL_SetAffinity(), if you plan to use both (you have "mysql" and "sqlite" available, it's possible to create another driver), you need to manually enable them in modules.ini. So with both loaded, you can switch affinity anytime. If you need just mysql, you have nothing to do because it will load automatically mysql module by default when you include sqlx.inc. |
Re: Require module sqlite
And to load only sqlite, you can do that:
#pragma defclasslib sqlx sqlite #include <sqlx> |
Re: Require module sqlite
So it isn't possible to require both of them via plugin?
|
Re: Require module sqlite
This looks like this works for me this:
Code:
#include "sqlx"When you use "defclasslib", it's basically saved in a list and amxx will try to load module named with second param, here "sqlite". |
Re: Require module sqlite
Sweet, works nicely. I think this should be somewhere stated in include file so that other would see it, too if they use sqlite :)
|
| All times are GMT -4. The time now is 17:41. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.