[NFR] mssql extension
no one use sqlserver? i am ready to fly with phalcon... but... my db is sqlserver.... i plan to start a phalcon project in a week....
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Can be considered, the use of ODBC. I try it.
i use freetds to connect with sql server.
To complete the expansion, there are several SQL needs to be done: 1.describing a table (column_name, data_type, character_maximum_length, numeric_precision, numeric_scale, is_nullable, constraint_type, column_default, column_id) 2.List all tables on database (table_name, owner) 3.list all views of a schema (view_name) 4.query indexes on a table (table_name, index_name, index_type, column_name) 5.query foreign keys on a table (table_name, column_name, constraint_name, owner, table_name, column_name) I am not familiar with SQLServer, but not installed SQLServer so I can not accomplish this, you can help accomplish them?
i do really want to help, but i'm not familiar with C... I will try to implement in Phalcon\Db\Adapter way first.
i had implemeted it in PHP. https://github.com/fishjerky/phalcon-mssql it works well in most cases, but still has some issues. i'll fix it later.
@fishjerky Good.
hi, @dreamsxin i have problems passing PaginationTest.php but i can pass ArrayPaginator and ModelPaginator, but not QueryBuilder https://github.com/phalcon/cphalcon/blob/master/unit-tests/PaginatorTest.php#L348 it seems i can' get the items greater than page 2 (page 100 in this case) Do you have any idea? The following is my expansion https://github.com/fishjerky/phalcon-mssql
You can print the sql check:
$builder = $this->modelsManager->createBuilder()
->columns('cedula, nombres')
->from('Personnes')
->orderBy('cedula')
->limit(500, 0);
var_dump($builder->getPhql());
SELECT cedula, nombres FROM [Personnes] ORDER BY cedula LIMIT 500 OFFSET 0
Sqlserver does not support the limit
as you mentioned, it is
SELECT cedula, nombres FROM [Personnes] ORDER BY cedula LIMIT 500 OFFSET 0
i already fix this in my expansion, but ... QueryBuilder doesn't call any function inside adapter or dialect.
what can i do?
@fishjerky you can override the method "select" in the dialect to generate the proper SQL that simulate an offset in SQLServer
hi, @phalcon . I already did in my expansion https://github.com/fishjerky/phalcon-mssql/blob/master/unit-tests/db/dialect/Mssql.php#L17 i try to echo the final sql statement in "select" method, and got nothing. i think querybuilder didn't call "select".
how you try a join statement?
+1
+1
@fishjerky as far as i know you don't need to know C know, i know you posted here 3 years ago so you probably not even using phalcon but you can write this mysql dapter in more common language.
Im guessing that dev team like anders or klay are not using mssql anywhere, so to implement this there definitely must be someone who is using it and working on it and know all things about mssql stuff.
Microsoft SQL server support is in the same realm as Oracle. We do have some interest but it is very small. As a result, the Oracle adapter has been moved to the Incubator repository, and the same should happen to MSSQL.
Frankly none of us has the means to accurately test these adapters and automated testing will not work since Travis does not support these.
If you or anyone from the community wants to take the lead and work on the adapter by all means. The documentation has examples on how to work with dialects and how to implement the adapter.
playing deaf... by the way, @Jurigag! i'm still using phalcon .... 1.3....
So maybe it's time to update it ? :D It will be never added to 1.3 since it's dropped like few years ago, you know this right ? Then you can write adapter in zephir. What you mean deaf ? We just don't know mssql, every sql engine has their "things" which can be diffrent from other. Probably no one in dev team know mssql, so why we should start making mssql adapter ? Better someone who already know mssql. And as i wrote - you don't need to know C now to implement it.
With the new mssql docker container available I would like to add this to the voting list @niden