|
171 | 171 | @test data[1][1] === Int64(1) |
172 | 172 | @test data[1][2] === Int64(2) |
173 | 173 |
|
174 | | - @testset "Streaming mysql data to CSV" begin |
175 | | - # Test exporting test1 to CSV |
176 | | - temp_filename = "mysql_test1.csv" |
177 | | - source = ODBC.Query(dsn, "select * from test1") |
178 | | - CSV.write(temp_filename, source) |
| 174 | + # @testset "Streaming mysql data to CSV" begin |
| 175 | + # # Test exporting test1 to CSV |
| 176 | + # temp_filename = "mysql_test1.csv" |
| 177 | + # source = ODBC.Query(dsn, "select * from test1") |
| 178 | + # CSV.write(temp_filename, source) |
179 | 179 |
|
180 | | - open(temp_filename) do f |
181 | | - @test readline(f) == ( |
182 | | - "test_bigint,test_bit,test_decimal,test_int,test_numeric," * |
183 | | - "test_smallint,test_mediumint,test_tiny_int,test_float,test_real," * |
184 | | - "test_date,test_datetime,test_timestamp,test_time,test_year," * |
185 | | - "test_char,test_varchar,test_binary,test_varbinary,test_tinyblob," * |
186 | | - "test_blob,test_mediumblob,test_longblob,test_tinytext,test_text," * |
187 | | - "test_mediumtext,test_longtext" |
188 | | - ) |
189 | | - @test readline(f) == ( |
190 | | - "1,1,1.0,1,1.0,1,1,1,1.2,1.2,2016-01-01,2016-01-01T01:01:01,2016-01-01T01:01:01,01:01:01,2016,A,hey there sailor,\"UInt8[0x31, 0x32]\",,\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x61, 0x62, 0x72, 0x61, 0x68, 0x61, 0x6d]\",\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x62, 0x69, 0x6c, 0x6c]\",\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x63, 0x68, 0x61, 0x72, 0x6c, 0x69, 0x65]\",\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x64, 0x61, 0x6e]\",hey there ephraim,hey there frank,hey there george,hey there hank" |
191 | | - ) |
192 | | - @test readline(f) == ( |
193 | | - "2,1,2.0,2,2.0,2,2,2,2.2,2.2,2016-01-01,2016-01-01T01:01:01,2016-01-01T01:01:01,01:01:01,2016,B,hey there sailor,\"UInt8[0x31, 0x32]\",,\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x61, 0x62, 0x72, 0x61, 0x68, 0x61, 0x6d, 0x32]\",\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x62, 0x69, 0x6c, 0x6c, 0x32]\",\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x63, 0x68, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x32]\",\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x64, 0x61, 0x6e, 0x32]\",hey there ephraim2,hey there frank2,hey there george2,hey there hank2" |
194 | | - ) |
195 | | - end |
196 | | - rm(temp_filename) |
197 | | - end |
| 180 | + # open(temp_filename) do f |
| 181 | + # @test readline(f) == ( |
| 182 | + # "test_bigint,test_bit,test_decimal,test_int,test_numeric," * |
| 183 | + # "test_smallint,test_mediumint,test_tiny_int,test_float,test_real," * |
| 184 | + # "test_date,test_datetime,test_timestamp,test_time,test_year," * |
| 185 | + # "test_char,test_varchar,test_binary,test_varbinary,test_tinyblob," * |
| 186 | + # "test_blob,test_mediumblob,test_longblob,test_tinytext,test_text," * |
| 187 | + # "test_mediumtext,test_longtext" |
| 188 | + # ) |
| 189 | + # @test readline(f) == ( |
| 190 | + # "1,1,1.0,1,1.0,1,1,1,1.2,1.2,2016-01-01,2016-01-01T01:01:01,2016-01-01T01:01:01,01:01:01,2016,A,hey there sailor,\"UInt8[0x31, 0x32]\",,\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x61, 0x62, 0x72, 0x61, 0x68, 0x61, 0x6d]\",\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x62, 0x69, 0x6c, 0x6c]\",\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x63, 0x68, 0x61, 0x72, 0x6c, 0x69, 0x65]\",\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x64, 0x61, 0x6e]\",hey there ephraim,hey there frank,hey there george,hey there hank" |
| 191 | + # ) |
| 192 | + # @test readline(f) == ( |
| 193 | + # "2,1,2.0,2,2.0,2,2,2,2.2,2.2,2016-01-01,2016-01-01T01:01:01,2016-01-01T01:01:01,01:01:01,2016,B,hey there sailor,\"UInt8[0x31, 0x32]\",,\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x61, 0x62, 0x72, 0x61, 0x68, 0x61, 0x6d, 0x32]\",\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x62, 0x69, 0x6c, 0x6c, 0x32]\",\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x63, 0x68, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x32]\",\"UInt8[0x68, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x64, 0x61, 0x6e, 0x32]\",hey there ephraim2,hey there frank2,hey there george2,hey there hank2" |
| 194 | + # ) |
| 195 | + # end |
| 196 | + # rm(temp_filename) |
| 197 | + # end |
198 | 198 |
|
199 | 199 | @testset "Exporting mysql data to SQLite" begin |
200 | 200 | # Test exporting test1 to SQLite |
201 | 201 | db = SQLite.DB() |
202 | 202 | source = ODBC.Query(dsn, "select * from test1") |
203 | 203 | SQLite.load!(source, db, "mysql_test1") |
204 | 204 |
|
205 | | - data = SQLite.query(db, "select * from mysql_test1") |
| 205 | + data = SQLite.Query(db, "select * from mysql_test1") |> DataFrame |
206 | 206 | @test size(data) == (2,27) |
207 | 207 | @test data[1][1] === 1 |
208 | 208 | @test data[10][1] === 1.2 |
|
0 commit comments