Turns out I wasn't subscribed to the list on this email account, let's try that again.
----- Original Message -----
From: "Mark Raasveldt"
To: "Kevork Vartanian"
Cc: "users-list"
Sent: Thursday, March 17, 2016 11:25:35 AM
Subject: Re: MonetDB schema for Yii 1.1 (PHP framework)?
Hey Kevork,
I don't mind answering questions through email, but I'm afraid I have nothing to do with the PHP client (in fact, I didn't even know we had a PHP client for MonetDB). The author at the top of the page simply states who has performed the last commit to the MonetDB repository, not who created or authored that specific file. You must have clicked on the file after I performed a commit.
I have CCed this message to the users' list, hopefully someone that at least knows about the existence of the MonetDB PHP client can help you out there.
Regards,
Mark
----- Original Message -----
From: "Kevork Vartanian"
To: "m raasveldt"
Sent: Thursday, March 17, 2016 4:31:54 AM
Subject: MonetDB schema for Yii 1.1 (PHP framework)?
Hi Mark,
Hope this email finds you well.
Apologies in advance in case you don't like to be contacted directly by email. I saw your name and email address as being the author of the MonetDB PHP client (https://dev.monetdb.org/hg/MonetDB/file/tip/clients/php/lib/php_monetdb.php) and wanted to contact you to ask a few questions, if you don't mind, of course.
I am working on a mini project and using the Yii 1.1 PHP framework (OOP framework, using MVC) and trying to connect to a MonetDB database (changing from MySQL).
I can see the PHP client is MAPI based, but I don't know if that can be used in Yii by creating a wrapper or so.
Yii has special classes to retrieve metadata information from database (the http://www.yiiframework.com/doc/api/1.1/CDbSchema) and it also has subclasses for several databases supported in Yii "out of the box" (cubrid, mssql, mysql, oci, pgsql and sqlite). It uses the CActiveDataProvider class which is based on ActiveRecord (http://www.yiiframework.com/doc/api/1.1/CActiveDataProvider), and has methods to retrieve the data from database along with different criteria.
Knowing MonetDB also has an ODBC driver, I installed unixodbc along with the PHP PDO driver for ODBC, the MonetDB ODBC driver, and have done all the needed set up to make ODBC work. By the way, my test server is an Ubuntu VM.
Now that I have the ODBC working, I am able to connect to the database, and when using SQL statements (building the sql query, command, datareader, etc) everything works in Yii, and I can retrieve the needed data, but when I want to use the widgets and make use of the framework and MVC, I start getting errors and I believe it's all because of not having the right schema class. I tried "forcing" the driver name and tested all the existing schemas (the ones I specified above, that come with Yii) but to no avail.
I'm not a database expert or an advanced PHP (and Yii) developer but have some development experience and was able to work on this project and build a nice web application with MySQL but now that I'm planning to change the DB and use MonetDB, I believe I need expert advice and some help from real experts.
I don't know if you're familiar with Yii but do you think what I'm trying to achieve is doable? Also, MonetDB being columnar, I was thinking maybe I should look into the Yii classes for PostgreSQL (main one being http://www.yiiframework.com/doc/api/1.1/CPgsqlSchema with source code: https://github.com/yiisoft/yii/blob/1.1.17/framework/db/schema/pgsql/CPgsqlS...) and try to make similar ones for MonetDB but I doubt I will be able to do it without some help and guidance from experts.
Your advice is greatly appreciated.
Thank you.
Regards,
Kevork Vartanian
Technical Solutions Consultant
kevork.vartanian@innotta.com.au | +61 406 776 789 | www.innotta.com.au