Commit Graph

26 Commits

Author SHA1 Message Date
peace-maker
e5342afe2a
Add PostgreSQL database driver (#32)
* Add PostgreSQL DBI extension

Bug #3849
This adds a postgresql database driver called "pgsql".
The ambuild script changes could be very wrong ;)

* Add pgsql support to clientprefs

This was originally made by Lyfe in bug 3849! Thanks for that.
PostgreSQL supports the 'IF NOT EXISTS' clause when creating tables
since version 9.1, so i've switched to use that.

* Added pgsql support to sql-admin-manager

* Add --pgsql-path to ambuild configure

* More ambuild fixes

* Compile libpq with ambuild

* Try to generate postgres configs

* Add dummy config file

* More ambuild fixes

* Get errorcode and readable error in preparequery

No need to stop getting the errorCode, if the error string should be
retrieved. Just return both!

* Fix indentation in AMBuilderPGSQL

* Try to patch and configure postgres through ambuild

* Revert "Try to patch and configure postgres through ambuild"

This reverts commit 68dfc82b8eb0ce11f621af67ec247b5f47e4a189.

* Update to use PostgreSQL 9.4

* Move postgres preparation into seperate script

Fetching, preparing and configuring of the postgresql sourcecode
is done in a seperate prepare_postgresql.sh script now.

People can use this script for their manual builds,
if they don't want to use checkout-deps.sh.

* Add patch to configure.in again

Remove the version check for autoconf in postgres 9.4 too.

* Nit: Support older objdirs for hasPgSql ambuild option

* Update to use PostgreSQL 9.4.6

* Use newer AMTL and PGSQL 9.6

* Fix threaded queries

When running the thread part of a query, it already gets the atomic
lock. Don't try to get it twice in that case.

Use a seperate lock to protect access to the lastInsertID and
lastAffectedRows variables.

* Fix SetCharacterSet racing with threaded queries

Same fix like in the mysql driver.

* Use ke::AutoLock for lastInsertID mutex

* Fix fetching one more row than available

Don't try to access a row that doesn't exist when iterating rows.

* Improve sanity checks on column access

Don't call libpq functions with out of bounds column indices.

* Let QuoteString return false if quoting failed

* Fix build for x64 support changes and update to PGSQL 9.6.9

* Fix linux build

* Fix building of connection options string

snprintf doesn't support overlapping buffers.

* Update to PostgreSQL 9.6.15

* Fix crash after freeing first IQuery object

* Fix code crunch

* Fix memory leak, cleanup

* Nuke MSVC project and Makefile

* Remove unsupported numeric error codes

* Use STL threads

* Add prebuilt libpq for Linux and Windows

* Restore and fix version.rc file

* Add PostgreSQL build instructions

* Add prebuilt libpq for Mac

* Add win64 libpq build

This is version 9.6.15 since that's what I still had laying around.

* Fix buildscript

* Fix x64 build on linux and mac

Co-authored-by: Erik Minekus <tsunami@tsunami-productions.nl>
2021-03-11 11:21:51 +01:00
David Anderson
5d94f0bea8 Replace ke::Vector with std::vector. 2020-05-31 11:35:51 -07:00
David Anderson
a253e175bb Replace all uses of AMTL threads with STL threads.
This also rewrites the work loop for threaded queries. It has been
simplified significantly.
2020-05-16 22:35:56 -07:00
David Anderson
e2b399b8d3 Update to the latest AMTL - Rename Ref to RefPtr. 2015-11-08 13:14:57 -08:00
Nicholas Hastings
ea86eee74e Fix SetAuthIdCookie's IsAuthIdConnect function's issues with mixed auth id types. 2014-11-15 09:34:49 -05:00
Nicholas Hastings
570570f7a0 Fix regression causing inconsistencies in clientprefs auth id handling (r=VoiDeD). 2014-09-12 13:04:37 -07:00
Kyle Sanderson
695fc802a9 Replace SourceHook list usages in clientprefs with AMTL. 2014-06-04 21:49:48 -07:00
Kyle Sanderson
b1901da79f Unify Maximum supported clients, raised SDKTools limit (bug 5964, r=psychonic). 2014-05-06 18:40:35 -07:00
David Anderson
dac42ee272 Add reference counting to IDatabase (bug 5876 part 2, r=ds).
--HG--
extra : rebase_source : 9fef982c3923a2f5cb842b3b8a5cca235ef9c6b9
2013-08-23 00:18:12 -07:00
David Anderson
c373527851 Rename ke_* headers to am-*
--HG--
rename : public/amtl/ke_allocator_policies.h => public/amtl/am-allocator-policies.h
rename : public/amtl/ke_inline_list.h => public/amtl/am-inline-list.h
rename : public/amtl/ke_thread_posix.h => public/amtl/am-thread-posix.h
rename : public/amtl/ke_thread_utils.h => public/amtl/am-thread-utils.h
rename : public/amtl/ke_thread_windows.h => public/amtl/am-thread-windows.h
rename : public/amtl/ke_utility.h => public/amtl/am-utility.h
rename : public/amtl/ke_vector.h => public/amtl/am-vector.h
2013-08-22 17:10:59 -07:00
David Anderson
de8726ab73 Move ke_ headers to new public/amtl folder.
--HG--
rename : public/sourcepawn/ke_allocator_policies.h => public/amtl/ke_allocator_policies.h
rename : public/sourcepawn/ke_inline_list.h => public/amtl/ke_inline_list.h
rename : public/sourcepawn/ke_thread_posix.h => public/amtl/ke_thread_posix.h
rename : public/sourcepawn/ke_thread_utils.h => public/amtl/ke_thread_utils.h
rename : public/sourcepawn/ke_thread_windows.h => public/amtl/ke_thread_windows.h
rename : public/sourcepawn/ke_utility.h => public/amtl/ke_utility.h
rename : public/sourcepawn/ke_vector.h => public/amtl/ke_vector.h
2013-08-22 16:30:44 -07:00
David Anderson
94d33a4ef1 Fix various problems with unloading ClientPrefs and SourceMod (bug 5874, r=ds).
--HG--
extra : rebase_source : 0a35f8380d651ca65fac9dd402c5cd3625e3105c
2013-08-22 14:05:44 -07:00
Kyle Sanderson
5d942265f9 Overhaul of ClientPrefs extension (bug 5538, r=asherkin). 2013-02-28 21:51:49 +00:00
Nicholas Hastings
3479e452de Fixed clientprefs prefab menu double free crash (bug 5374, r=asherkin). 2012-07-03 07:51:12 -04:00
Asher Baker
997c7ebbcf Made clientprefs attempt to reconnect to the database on map change (bug 4745, r=dvander). 2012-05-24 16:07:28 +01:00
Don
00f152910b Added native to clientprefs to alter data on a disconnected player (bug 3882, r=pred). 2011-10-14 11:28:53 -04:00
Nicholas Hastings
3de61b69ad Raised MAXPLAYERS from 64 to 65 (bug 4490, r=dvander). 2011-01-16 20:06:55 -05:00
David Anderson
0a060982e3 Fixed extension version reporting. 2009-08-30 01:54:45 -07:00
David Anderson
d3f0a14867 Imported support for new build system. 2009-08-30 00:21:42 -07:00
David Anderson
253109d1c9 Rewrote querying in client prefs to not use prepared queries (bug 2698, r=pred).
Prepared queries had annoying race conditions and became unusable on connection timeouts.
2008-10-20 03:40:46 -05:00
Matt Woodrow
e64e2534eb Fixed amb1810 - Clientprefs no longer blocks load.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402418
2008-07-15 00:24:08 +00:00
David Anderson
b01dd0798c clientprefs now uses the new dbi dependency shim
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402316
2008-07-01 06:13:09 +00:00
Matt Woodrow
044ee841f2 Fixed amb1690 - Client prefs tables now create themselves.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402199
2008-05-26 07:51:36 +00:00
Scott Ehlert
9023afff0d Trunk build fixes
Fixed up IGameHelpers.h such that it no longer requires HL2SDK headers if a function doesn't need them

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402144
2008-05-13 08:22:49 +00:00
Matt Woodrow
d88ba02fde CLIENT PREFS ARE GO!!1!shiftone!!1!
Fully implemented amb734 - Including console interface and menu for clients to use.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402140
2008-05-12 08:06:47 +00:00
Matt Woodrow
e63a5cd3dc Initial import of amb734 - Client preferences extension.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402072
2008-04-17 04:58:09 +00:00