Skip to content

Commit a495f32

Browse files
committed
fix: trailing nullcols hardcoded sql
1 parent e8c6c27 commit a495f32

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ $loader->inFile(database_path('files/employees.csv'))
3535
],
3636
terminatedBy: ',',
3737
enclosedBy: '"',
38-
trailing: null
38+
trailing: true
3939
)
4040
->disk('local')
4141
->execute();

src/SQLLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function into(
7373
array $columns,
7474
?string $terminatedBy = ',',
7575
?string $enclosedBy = '"',
76-
?string $trailing = null,
76+
bool $trailing = false,
7777
array $formatOptions = []
7878
): static {
7979
$this->tables[] = new TableDefinition($table, $columns, $terminatedBy, $enclosedBy, $trailing, $formatOptions);

src/TableDefinition.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function __construct(
1111
public array $columns,
1212
public ?string $terminatedBy = null,
1313
public ?string $enclosedBy = null,
14-
public ?string $trailing = null,
14+
public bool $trailing = false,
1515
public array $formatOptions = []
1616
) {
1717
}
@@ -29,7 +29,7 @@ public function __toString(): string
2929
}
3030

3131
if ($this->trailing) {
32-
$sql .= $this->trailing.PHP_EOL;
32+
$sql .= 'TRAILING NULLCOLS'.PHP_EOL;
3333
}
3434

3535
if ($this->formatOptions) {

0 commit comments

Comments
 (0)