11using System ;
2+ using System . Data . SQLite ;
23
3- namespace System . Data . SQLite
4+ namespace System . Data . SQLite . Benchmark
45{
56 using Vdbe = Sqlite3 . Vdbe ;
67
@@ -23,12 +24,7 @@ public SQLiteVdbe(SQLiteDatabase db, String query)
2324 vm = null ;
2425
2526 // prepare and compile
26- #if NET_35
27- Sqlite3 . PrepareV2NoTail
28- #else
29- Sqlite3 . sqlite3_prepare_v2
30- #endif
31- ( db . Connection ( ) , query , query . Length , ref vm , 0 ) ;
27+ Sqlite3 . sqlite3_prepare_v2 ( db . Connection ( ) , query , query . Length , ref vm , 0 ) ;
3228 }
3329
3430 /// <summary>
@@ -50,13 +46,7 @@ public Vdbe VirtualMachine()
5046 /// <returns>LastResult</returns>
5147 public int BindInteger ( int index , int bInteger )
5248 {
53- if ( ( LastResult =
54- #if NET_35
55- Sqlite3 . BindInt
56- #else
57- Sqlite3 . sqlite3_bind_int
58- #endif
59- ( vm , index , bInteger ) ) == Sqlite3 . SQLITE_OK )
49+ if ( ( LastResult = Sqlite3 . sqlite3_bind_int ( vm , index , bInteger ) ) == Sqlite3 . SQLITE_OK )
6050 {
6151 LastError = "" ;
6252 }
@@ -76,13 +66,7 @@ public int BindInteger(int index, int bInteger)
7666 /// <returns>LastResult</returns>
7767 public int BindLong ( int index , long bLong )
7868 {
79- if ( ( LastResult =
80- #if NET_35
81- Sqlite3 . BindInt64
82- #else
83- Sqlite3 . sqlite3_bind_int64
84- #endif
85- ( vm , index , bLong ) ) == Sqlite3 . SQLITE_OK )
69+ if ( ( LastResult = Sqlite3 . sqlite3_bind_int64 ( vm , index , bLong ) ) == Sqlite3 . SQLITE_OK )
8670 {
8771 LastError = "" ;
8872 }
@@ -101,13 +85,7 @@ public int BindLong(int index, long bLong)
10185 /// <returns>LastResult</returns>
10286 public int BindText ( int index , string bText )
10387 {
104- if ( ( LastResult =
105- #if NET_35
106- Sqlite3 . BindText
107- #else
108- Sqlite3 . sqlite3_bind_text
109- #endif
110- ( vm , index , bText , - 1 , null ) ) == Sqlite3 . SQLITE_OK )
88+ if ( ( LastResult = Sqlite3 . sqlite3_bind_text ( vm , index , bText , - 1 , null ) ) == Sqlite3 . SQLITE_OK )
11189 {
11290 LastError = "" ;
11391 }
@@ -126,13 +104,7 @@ public int BindText(int index, string bText)
126104 public int ExecuteStep ( )
127105 {
128106 // Execute the statement
129- int LastResult =
130- #if NET_35
131- Sqlite3 . Step
132- #else
133- Sqlite3 . sqlite3_step
134- #endif
135- ( vm ) ;
107+ int LastResult = Sqlite3 . sqlite3_step ( vm ) ;
136108 return LastResult ;
137109 }
138110
@@ -143,13 +115,7 @@ public int ExecuteStep()
143115 /// <returns>Result column</returns>
144116 public long Result_Long ( int index )
145117 {
146- return
147- #if NET_35
148- Sqlite3 . ColumnInt64
149- #else
150- Sqlite3 . sqlite3_column_int64
151- #endif
152- ( vm , index ) ;
118+ return Sqlite3 . sqlite3_column_int64 ( vm , index ) ;
153119 }
154120
155121 /// <summary>
@@ -159,13 +125,7 @@ public long Result_Long(int index)
159125 /// <returns>Result column</returns>
160126 public string Result_Text ( int index )
161127 {
162- return
163- #if NET_35
164- Sqlite3 . ColumnText
165- #else
166- Sqlite3 . sqlite3_column_text
167- #endif
168- ( vm , index ) ;
128+ return Sqlite3 . sqlite3_column_text ( vm , index ) ;
169129 }
170130
171131 /// <summary>
@@ -186,12 +146,7 @@ public int ResultColumnCount()
186146 public void Reset ( )
187147 {
188148 // Reset the statment so it's ready to use again
189- #if NET_35
190- Sqlite3 . Reset
191- #else
192- Sqlite3 . sqlite3_reset
193- #endif
194- ( vm ) ;
149+ Sqlite3 . sqlite3_reset ( vm ) ;
195150 }
196151
197152 /// <summary>
@@ -201,12 +156,7 @@ public void Reset()
201156 /// <returns>LastResult</returns>
202157 public void Close ( )
203158 {
204- #if NET_35
205- Sqlite3 . Finalize
206- #else
207- Sqlite3 . sqlite3_finalize
208- #endif
209- ( vm ) ;
159+ Sqlite3 . sqlite3_finalize ( vm ) ;
210160 }
211161 }
212162}
0 commit comments