c# - DbExtensions - Cannot Manipulate SqlBuilder -


i have existing sqlbuilder, looks this

var query = sql     .where("field1 = {0}", "bob"); 

now want pass sqlbuilder function, can manipulated, select, , additional clauses can added it, doesnt seem possible?

if pass sqlbuilder function , call .select so

public void myfunction(sqlbuilder sqlbuilder) {     var newbuilder = sqlbuilder.clone()         .select("*")         .from("mytable")         .where("field2 = {0}", "something"); } 

now expect sql like

select * mytable field1 = 'bob' , field2 = 'something' 

but instead sql equal to

where field1 = 'bob' select * mytable field2 = 'something' 

obviously invalid. how can want? not possible dbextensions?

as said, manipulate existing sqlbuilder (clone first) , add additional clauses it. have add each clause in order? thought hold each in sort of background dictionary until needed create sql string?

with sqlbuilder, order matters, stringbuilder. have either adapt code, or use sqlset instead.


Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -