[nem-en] SQL macros (dataSqlClient.n)

Ildar Mulyukov ildar at users.sourceforge.net
Wed Oct 18 12:32:43 CEST 2006


On 18.10.2006 15:37:05, Kamil Skalski wrote:
> Cool, this is a nice work. Did it actually work for you?
Works for me (C) :)
At least compilation was successful, giving warnings like these:
Trigger.n:37:4:37:21: warning: N168: a local value args was never used
Trigger.n:37:4:37:21: warning: N168: a local value tid was never used
Trigger.n:37:4:37:21: warning: N168: a local value condition was never

where ``args, tid, condition'' are fields of my sqlite3 database.

> I need to check myself, but last time I tried to migrate the macros  
> in similar way to Sqlite it crashed (it was transactions or maybe  
> fetching DB schema).
> I'm sure that we can use strings for generating SqliteConnection /
> SqlClient / ... usage inside code, like:
> def conn_class = Macros.NewName ("SqliteConnection");
> <[ def conn = $(conn_class : name) ($(conn_string : string)); ]>
> there is additional problem that we need to use proper namespaces, so
> the classes should be fully qualified.
> This way all the code generation could be hopefully common.
Agree.

> And for the compile-time execution I cannot see other choices than   
> using reflection to instantiate provider specific objects and having   
> the customized implementation of stuff, where providers differ   
> between  each other in some helper classes. Making this  
> provider-independent  seems very hard and not worth the effort though.
Almost agree. Tough case. Though it would be nice to have a  
ready-to-use file for the following:
1. add this file as a subproject, target=library
2. make the main project dependent on this macro library
Ideally, the file should be ready-to-be-used without any changes,  
depending on the database, that I use and switching off everything else.

Ildar.
--
Ildar  Mulyukov,
   free SW designer/programmer
================================================
email: ildar at users.sourceforge.net
projects: http://os-development.sourceforge.net/
home: http://tuganger.narod.ru/
ALT Linux Sisyphus
================================================



More information about the devel-en mailing list