SQLite is a great database to unit test (TDD) applications. You can run it in memory with your tests ...

I've found a problem when I was unit testing my application. MySQL (production database) supports EXTRACT SQL standard function. SQLite don't support it. It would be great to have support in this standard.

MySQL examples:

Input:
SELECT EXTRACT(DAY FROM CURRENT_DATE)
Output:
EXTRACT(DAY FROM CURRENT_DATE)
10

Input:
SELECT EXTRACT(
MONTH FROM CURRENT_DATE )
Output:
EXTRACT(MONTH FROM CURRENT_DATE)
2

Input:
SELECT EXTRACT( YEAR
FROM CURRENT_DATE )
Output:
EXTRACT(YEAR FROM CURRENT_DATE)
2012

Unfortunately, strftime isn't a solution. It's not a standard.

Possible EXTRACT reference: http://oreilly.com/catalog/sqlnut/chapter/ch04.html#_Toc484170297

Sorry about my English and thank you very much.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to