About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
[Solved] EE 2.0 Doesn't want to parse a header
Author Message
Houge Offline
Silver Supporter

Post: #1
[Solved] EE 2.0 Doesn't want to parse a header
Hello!

I faced the problem: I installed PostgreSQL 9.3 and i'm trying to use it's header in EE 2.0. I include full header path - "C:\PostgreSQL\9.3\include\libpq-fe.h" but there are no classes in autocomplete system. Nevertheless it builds and works.
(This post was last modified: 03-12-2014 06:09 AM by Houge.)
02-26-2014 05:20 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #2
RE: EE 2.0 Doesn't want to parse a header
UP, it prevents me from creation a functions with return variable types from this header, like
Code:
PGconn* DatabaseConnection(PGconn *conn, Str user, Str pwd)
{
    conn = PQconnectdb(Str8("user=user password=1 dbname=db hostaddr=127.0.0.1 port=5432"));
  
    if (PQstatus(conn) != CONNECTION_OK)
    {
       Gui.msgBox("Error connecting to DB!", S+PQstatus(conn));
       return NULL;
    }
    
    return conn;
}

Interesting thing: if i create such code it is replaced by EE with the following when building:
Code:
/******************************************************************************/
// VARIABLES
/******************************************************************************/
extern PGconn* DatabaseConnection(PGconn *conn, Str user, Str pwd)
{
    conn = PQconnectdb(Str8(L"user=user password=1 dbname=db hostaddr=127.0.0.1 port=5432"));
/******************************************************************************/
// FUNCTIONS
/******************************************************************************/

so VS stops compilation. But if i use it like that:
Code:
PGconn* DatabaseConnection(PGconn *conn)
{
    conn = PQconnectdb(Str8("user=user password=1 dbname=db hostaddr=127.0.0.1 port=5432"));
  
    if (PQstatus(conn) != CONNECTION_OK)
    {
       Gui.msgBox("Error connecting to DB!", S+PQstatus(conn));
       return NULL;
    }
    
    return conn;
}
Everything is ok.
02-28-2014 06:05 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #3
RE: EE 2.0 Doesn't want to parse a header
UP! Greg! I found the reason:
At header start there is a line
Code:
extern      "C"
{
... all the code ...
}

If i remove it, then header is parsed, but of course it doesn't compile smile
Can you do sonething with it?
03-02-2014 02:00 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: EE 2.0 Doesn't want to parse a header
Thanks, I'll investigate it.
Could you also let me know why are you using PostgreSQL ? Are there any advantages in using it instead of builtin MS SQL, MySQL, SQLite?
Thanks
03-02-2014 08:55 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: EE 2.0 Doesn't want to parse a header
Next release will have this feature:
-added support for parsing headers with 'extern "C"'
03-02-2014 11:51 PM
Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #6
RE: EE 2.0 Doesn't want to parse a header
(03-02-2014 11:51 PM)Esenthel Wrote:  Next release will have this feature:
-added support for parsing headers with 'extern "C"'

Thanks a lot!!!

(03-02-2014 08:55 PM)Esenthel Wrote:  Thanks, I'll investigate it.
Could you also let me know why are you using PostgreSQL ? Are there any advantages in using it instead of builtin MS SQL, MySQL, SQLite?
Thanks

PostgreSQL vs MS SQL:
It's free and can be installed to Linux server

PostgreSQL vs MySQL:
You can use stored procedures, cursors, functional indexes, regular expressions and more. MySQL is more famous and PostgreSQL is much more powerful.

PostgreSQL vs SQLite:
They are in different weight categories smile

PostgreSQL is like a free version of Oracle without analytic functionality. Frankly speaking I wanted to use Oracle, but it is too expensive (40k$ per processor core is too much) so PostgreSQL is the best alternative.
(This post was last modified: 03-03-2014 06:19 AM by Houge.)
03-03-2014 04:54 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #7
RE: [Solved] EE 2.0 Doesn't want to parse a header
Thanks, Greg!
After today's release everything works great!
03-12-2014 06:10 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: [Solved] EE 2.0 Doesn't want to parse a header
Thanks for letting me know!
03-12-2014 06:12 AM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #9
RE: [Solved] EE 2.0 Doesn't want to parse a header
Sorry to necro this post, but I'd like to add that if PostgreSQL will be added, I'd like to suggest also thinking about adding support for NoSQL (perhaps http://unqlite.org/). I feel it is better suited for many common functions an app may require that can otherwise be offloaded to a DBMS, such as storing and very rapidly retrieving key/value pairs, columns of data, to name a few. While this is also doable with a relational DBMS like MySQL, MSSQL, PostgreSQL, etc. it is not very performant (and often heavy-weight towards compute resource) when the need is only a key/value retrieval system or the like that is well supported in a NoSQL system. Plus, this opens up the possibility of an Esenthel app to leverage one of the many fully cloud-based database systems out there that are NoSQL based, and many of them are very inexpensive (and even free!)

To further augment my last post, here is a nice background of NoSQL for those that are interested:
https://www.digitalocean.com/community/t...and-models
(This post was last modified: 11-09-2014 09:57 PM by aceio76.)
11-09-2014 09:43 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply