|
|
| version 1.49, 2011/05/19 06:58:40 | version 1.55, 2017/02/07 22:00:30 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: @b VOID parser class. | Parser: @b VOID parser class. |
| Copyright (c) 2001-2009 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| */ | */ |
| static const char * const IDENT_VOID_C="$Date$"; | |
| #include "classes.h" | #include "classes.h" |
| #include "pa_vmethod_frame.h" | #include "pa_vmethod_frame.h" |
| Line 14 static const char * const IDENT_VOID_C=" | Line 12 static const char * const IDENT_VOID_C=" |
| #include "pa_vvoid.h" | #include "pa_vvoid.h" |
| #include "pa_sql_connection.h" | #include "pa_sql_connection.h" |
| volatile const char * IDENT_VOID_C="$Id$"; | |
| // externs | // externs |
| extern String sql_bind_name; | extern String sql_bind_name; |
| Line 56 static void _sql(Request& r, MethodParam | Line 56 static void _sql(Request& r, MethodParam |
| HashStringValue* bind=0; | HashStringValue* bind=0; |
| if(params.count()>1) | if(params.count()>1) |
| if(HashStringValue* options=params.as_hash(1)) { | if(HashStringValue* options=params.as_hash(1, "sql options")) { |
| int valid_options=0; | int valid_options=0; |
| if(Value* vbind=options->get(sql_bind_name)) { | if(Value* vbind=options->get(sql_bind_name)) { |
| valid_options++; | valid_options++; |
| Line 71 static void _sql(Request& r, MethodParam | Line 71 static void _sql(Request& r, MethodParam |
| if(bind) | if(bind) |
| placeholders_count=marshal_binds(*bind, placeholders); | placeholders_count=marshal_binds(*bind, placeholders); |
| Temp_lang temp_lang(r, String::L_SQL); | |
| const String& statement_string=r.process_to_string(statement); | const String& statement_string=r.process_to_string(statement); |
| const char* statement_cstr=statement_string.untaint_cstr(r.flang, r.connection()); | const char* statement_cstr=statement_string.untaint_cstr(String::L_SQL, r.connection()); |
| Void_sql_event_handlers handlers(statement_string); | Void_sql_event_handlers handlers(statement_string); |
| r.connection()->query( | r.connection()->query( |
| Line 89 static void _sql(Request& r, MethodParam | Line 88 static void _sql(Request& r, MethodParam |
| // constructor | // constructor |
| MVoid::MVoid(): Methoded("void", string_class) { | MVoid::MVoid(): Methoded("void") { |
| set_base(string_class); | |
| // ^void:sql{query} | // ^void:sql{query} |
| add_native_method("sql", Method::CT_STATIC, _sql, 1, 2); | add_native_method("sql", Method::CT_STATIC, _sql, 1, 2); |