Skip to content

Commit 964a3e7

Browse files
committed
feat: input file os file proc clause
1 parent cc134df commit 964a3e7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/InputFile.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@ public function __construct(
1313
public ?string $badFile = null,
1414
public ?string $discardFile = null,
1515
public ?string $discardMax = null,
16+
public ?string $osFileProcClause = null,
1617
) {
1718
}
1819

1920
public function __toString(): string
2021
{
2122
$sql = "INFILE '{$this->path}'";
2223

24+
if ($this->osFileProcClause) {
25+
$sql .= " \"{$this->osFileProcClause}\"";
26+
}
27+
2328
if ($this->badFile) {
2429
$sql .= " BADFILE '{$this->badFile}'";
2530
}

tests/Unit/InputFileTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,9 @@
3131

3232
expect($inputFile->__toString())->toBe("INFILE 'path/to/file' BADFILE 'path/to/badfile' DISCARDFILE 'path/to/discardfile' DISCARDMAX 1");
3333
});
34+
35+
test('it can build with os file proc clause', function () {
36+
$inputFile = new InputFile('path/to/file', 'path/to/badfile', 'path/to/discardfile', '1', 'OS_FILE_PROC');
37+
38+
expect($inputFile->__toString())->toBe("INFILE 'path/to/file' \"OS_FILE_PROC\" BADFILE 'path/to/badfile' DISCARDFILE 'path/to/discardfile' DISCARDMAX 1");
39+
});

0 commit comments

Comments
 (0)