Building our own db adaptater

Hello All,

I have to build a connector to Salesforce. I would like to use it as a Db adaptateur being able to create the model and to attribute a connexion toward it.

I tryed to figure out how to do it, but did not see how to start.

Can you give me some direction or documentation, example to help, pls.

Regards

edited Dec '16

Hi there,

here you have the source code of Phalcon, including DB Adapter

SourceCode

Good luck!

Hello,

Thanks a lot for you replies.

I go through and now I'm able to retreive results, from query, QueryBuilder->execute.

But I got to main errors that block the system.

1st : is about LIMIT, any time I define a limit, the query is not working and I got the following message : Model 'Contact' could not be loaded

0 [internal function]: Phalcon\Mvc\Model\Manager->load('Contact', true)

in details: If I do : $contacts = \Extranet\Models\Contact::query()->execute(); WORK ! If I do $contacts = \Extranet\Models\Contact::query()->limit(10,10)->execute(); //whatever limit I got : Model 'Contact' could not be loaded

On the same idea, if I run : $contacts = \Extranet\Models\Contact::query()->where('Id > 12)->execute(); the final query appear as : SELECT id, name... from contact where Id=12 ????

2nd main error : Is when I $contact = Contact::findFirst('Id=15'); I got : Model 'Contact' could not be loaded

Of course the Model Contact exist, as it work well without "limit".

Any Idea ?

Regards