Skip to content

Commit

Permalink
Fixed codestyle, updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nick committed Oct 31, 2024
1 parent 4986d9e commit 6eb315b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Plugin/Insert/QueryParser/CheckInsertDataTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected static function checkTypeBundlesCompatibility(
): void {
$typeBundles = [
[Datatype::Json, Datatype::Null],
[Datatype::Multi64, Datatype::Multi, Datatype::Null],
[Datatype::Json, Datatype::Multi64, Datatype::Multi, Datatype::Null],
[Datatype::Float, Datatype::Bigint, Datatype::Int, Datatype::Null],
[Datatype::Text, Datatype::String, Datatype::Null],
[Datatype::Text, Datatype::Timestamp, Datatype::Null],
Expand Down
2 changes: 1 addition & 1 deletion test/Plugin/Insert/QueryParser/JSONInsertParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function testParseOk(): void {
'name' => 'test',
'cols' => ['col1', 'col2', 'col3', 'col4', 'col5', 'col6', 'col7', 'col8', 'col9', '@timestamp'],
'colTypes' => [
'string', 'int', 'bigint', 'json', 'multi', 'multi64', 'text', 'float', 'json', 'timestamp'
'string', 'int', 'bigint', 'json', 'multi', 'multi64', 'text', 'float', 'json', 'timestamp',
],
];
$this->assertEquals($res, self::$parser->parse($query));
Expand Down
6 changes: 3 additions & 3 deletions test/Plugin/Insert/QueryParser/SQLInsertParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function testParseOk(): void {
$query = 'INSERT INTO test(col1,col2,col3,col4,col5,col6,col7,col8,@timestamp) VALUES'
. "('[email protected]', 1, 111, '{\"b\":2}', (1,2), (1,11111111111), (0.2,0.8), 'c', '2000-01-01T12:00:00Z'),"
. "('[email protected]', 2, 222222222222, '{\"a\": \"(2,3)\"}', (2,3,4,5), (222222222222),"
. " 'qqq', '2000-01-01T12:00:30Z')";
. " (0.8,0.2), 'qqq', '2000-01-01T12:00:30Z')";
$res = [
'name' => 'test',
'cols' => ['col1', 'col2', 'col3', 'col4', 'col5', 'col6', 'col7', 'col8', '@timestamp'],
Expand All @@ -142,9 +142,9 @@ public function testParseOk(): void {
$parser = new SQLInsertParser();
$query = 'INSERT INTO test(col1,col2,col3,col4,col5,col6,col7,col8) VALUES'
. "\n"
. "('[email protected]', 1, 111111111111, '{\"b\":2}', (1,2), (1,111), (0.5,0.5), 'c'),"
. "('[email protected]', 1, 111111111111, '{\"b\":2}', (1,2), (1,111), (1,2), 'c'),"
. "\n"
. "('some text', 2, 222, '{\"a\": \"(2,3)\"}', (2,3,4,5), (222), (1,2), 'qqq')";
. "('some text', 2, 222, '{\"a\": \"(2,3)\"}', (2,3,4,5), (222), (0.5,1), 'qqq')";
$res = [
'name' => 'test',
'cols' => ['col1', 'col2', 'col3', 'col4', 'col5', 'col6', 'col7', 'col8'],
Expand Down

0 comments on commit 6eb315b

Please sign in to comment.