packages/sql-semantics-mysql/resources/models/Value/LoadWithLoadDataOrXmlLoadDataLockOptLocalInfileTextStringFilesystemOptDuplicateInto_905e40f5.php

1<?php
2
3declare(strict_types=1);
4
5namespace SqlSemantics\Statement\Model\MySql\Value;
6
7/**
8 * The load SQL value; generated by bin/build-models.php.
9 *
10 * @visibility public
11 * @example Accept a structured SQL value
12 *     $write = static fn (\SqlSemantics\Statement\Model\MySql\Value\LoadWithLoadDataOrXmlLoadDataLockOptLocalInfileTextStringFilesystemOptDuplicateInto_905e40f5 $value): string => \SqlSemantics\Statement\Writer::render($value);
13 *     $write instanceof \Closure // => true
14 */
15final class LoadWithLoadDataOrXmlLoadDataLockOptLocalInfileTextStringFilesystemOptDuplicateInto_905e40f5 implements \SqlSemantics\Statement\Model\MySql\Role\EvSqlStmtForm, \SqlSemantics\Statement\Model\MySql\Role\EvSqlStmtInnerForm, \SqlSemantics\Statement\Model\MySql\Role\LoadForm, \SqlSemantics\Statement\Model\MySql\Role\SpProcStmtForm, \SqlSemantics\Statement\Model\MySql\Role\SpProcStmtStatementForm, \SqlSemantics\Statement\Model\MySql\Role\StatementForm, \SqlSemantics\Statement\Model\MySql\Role\StoredRoutineBodyForm, \SqlSemantics\Statement\Model\MySql\Role\VerbClauseForm
16{
17    use \SqlSemantics\Statement\Assertion;
18
19    /**
20     * Supplies the SQL values of this form; comments are kept by the position of the symbol each precedes.
21     */
22    public function __construct(
23        public readonly \SqlSemantics\Statement\Model\MySql\Role\DataOrXmlForm $dataOrXml,
24        public readonly \SqlSemantics\Statement\Model\MySql\Role\LoadDataLockForm $loadDataLock,
25        public readonly \SqlSemantics\Statement\Model\MySql\Role\OptLocalForm $optLocal,
26        public readonly \SqlSemantics\Statement\Model\MySql\Role\TextStringFilesystemForm $textStringFilesystem,
27        public readonly \SqlSemantics\Statement\Model\MySql\Role\OptDuplicateForm $optDuplicate,
28        public readonly \SqlSemantics\Statement\Model\MySql\Role\TableIdentForm $tableIdent,
29        public readonly \SqlSemantics\Statement\Model\MySql\Role\OptUsePartitionForm $optUsePartition,
30        public readonly \SqlSemantics\Statement\Model\MySql\Role\OptLoadDataCharsetForm $optLoadDataCharset,
31        public readonly \SqlSemantics\Statement\Model\MySql\Role\OptXmlRowsIdentifiedByForm $optXmlRowsIdentifiedBy,
32        public readonly \SqlSemantics\Statement\Model\MySql\Role\OptFieldTermForm $optFieldTerm,
33        public readonly \SqlSemantics\Statement\Model\MySql\Role\OptLineTermForm $optLineTerm,
34        public readonly \SqlSemantics\Statement\Model\MySql\Role\OptIgnoreLinesForm $optIgnoreLines,
35        public readonly \SqlSemantics\Statement\Model\MySql\Role\OptFieldOrVarSpecForm $optFieldOrVarSpec,
36        public readonly \SqlSemantics\Statement\Model\MySql\Role\OptLoadDataSetSpecForm $optLoadDataSetSpec,
37        public readonly \SqlSemantics\Statement\Comments $comments = new \SqlSemantics\Statement\Comments(),
38    ) {
39        $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($dataOrXml), 'The dataOrXml must be a generated immutable SQL value.');
40        $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($loadDataLock), 'The loadDataLock must be a generated immutable SQL value.');
41        $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($optLocal), 'The optLocal must be a generated immutable SQL value.');
42        $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($textStringFilesystem), 'The textStringFilesystem must be a generated immutable SQL value.');
43        $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($optDuplicate), 'The optDuplicate must be a generated immutable SQL value.');
44        $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($tableIdent), 'The tableIdent must be a generated immutable SQL value.');
45        $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($optUsePartition), 'The optUsePartition must be a generated immutable SQL value.');
46        $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($optLoadDataCharset), 'The optLoadDataCharset must be a generated immutable SQL value.');
47        $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($optXmlRowsIdentifiedBy), 'The optXmlRowsIdentifiedBy must be a generated immutable SQL value.');
48        $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($optFieldTerm), 'The optFieldTerm must be a generated immutable SQL value.');
49        $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($optLineTerm), 'The optLineTerm must be a generated immutable SQL value.');
50        $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($optIgnoreLines), 'The optIgnoreLines must be a generated immutable SQL value.');
51        $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($optFieldOrVarSpec), 'The optFieldOrVarSpec must be a generated immutable SQL value.');
52        $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($optLoadDataSetSpec), 'The optLoadDataSetSpec must be a generated immutable SQL value.');
53    }
54
55    /**
56     * Writes SQL entirely from this value's fields.
57     */
58    public function write(\SqlSemantics\Statement\Writer $writer): void
59    {
60        $writer->comments($this->comments, 0);
61        $writer->append('LOAD');
62        $writer->comments($this->comments, 1);
63        $this->dataOrXml->write($writer);
64        $writer->comments($this->comments, 2);
65        $this->loadDataLock->write($writer);
66        $writer->comments($this->comments, 3);
67        $this->optLocal->write($writer);
68        $writer->comments($this->comments, 4);
69        $writer->append('INFILE');
70        $writer->comments($this->comments, 5);
71        $this->textStringFilesystem->write($writer);
72        $writer->comments($this->comments, 6);
73        $this->optDuplicate->write($writer);
74        $writer->comments($this->comments, 7);
75        $writer->append('INTO');
76        $writer->comments($this->comments, 8);
77        $writer->append('TABLE');
78        $writer->comments($this->comments, 9);
79        $this->tableIdent->write($writer);
80        $writer->comments($this->comments, 10);
81        $this->optUsePartition->write($writer);
82        $writer->comments($this->comments, 11);
83        $this->optLoadDataCharset->write($writer);
84        $writer->comments($this->comments, 12);
85        $this->optXmlRowsIdentifiedBy->write($writer);
86        $writer->comments($this->comments, 13);
87        $this->optFieldTerm->write($writer);
88        $writer->comments($this->comments, 14);
89        $this->optLineTerm->write($writer);
90        $writer->comments($this->comments, 15);
91        $this->optIgnoreLines->write($writer);
92        $writer->comments($this->comments, 16);
93        $this->optFieldOrVarSpec->write($writer);
94        $writer->comments($this->comments, 17);
95        $this->optLoadDataSetSpec->write($writer);
96    }
97
98    /**
99     * Returns a copy with a new dataOrXml, preserving every other field.
100     */
101    public function withDataOrXml(\SqlSemantics\Statement\Model\MySql\Role\DataOrXmlForm $dataOrXml): self
102    {
103        return new self($dataOrXml, $this->loadDataLock, $this->optLocal, $this->textStringFilesystem, $this->optDuplicate, $this->tableIdent, $this->optUsePartition, $this->optLoadDataCharset, $this->optXmlRowsIdentifiedBy, $this->optFieldTerm, $this->optLineTerm, $this->optIgnoreLines, $this->optFieldOrVarSpec, $this->optLoadDataSetSpec, $this->comments);
104    }
105
106    /**
107     * Returns a copy with a new loadDataLock, preserving every other field.
108     */
109    public function withLoadDataLock(\SqlSemantics\Statement\Model\MySql\Role\LoadDataLockForm $loadDataLock): self
110    {
111        return new self($this->dataOrXml, $loadDataLock, $this->optLocal, $this->textStringFilesystem, $this->optDuplicate, $this->tableIdent, $this->optUsePartition, $this->optLoadDataCharset, $this->optXmlRowsIdentifiedBy, $this->optFieldTerm, $this->optLineTerm, $this->optIgnoreLines, $this->optFieldOrVarSpec, $this->optLoadDataSetSpec, $this->comments);
112    }
113
114    /**
115     * Returns a copy with a new optLocal, preserving every other field.
116     */
117    public function withOptLocal(\SqlSemantics\Statement\Model\MySql\Role\OptLocalForm $optLocal): self
118    {
119        return new self($this->dataOrXml, $this->loadDataLock, $optLocal, $this->textStringFilesystem, $this->optDuplicate, $this->tableIdent, $this->optUsePartition, $this->optLoadDataCharset, $this->optXmlRowsIdentifiedBy, $this->optFieldTerm, $this->optLineTerm, $this->optIgnoreLines, $this->optFieldOrVarSpec, $this->optLoadDataSetSpec, $this->comments);
120    }
121
122    /**
123     * Returns a copy with a new textStringFilesystem, preserving every other field.
124     */
125    public function withTextStringFilesystem(\SqlSemantics\Statement\Model\MySql\Role\TextStringFilesystemForm $textStringFilesystem): self
126    {
127        return new self($this->dataOrXml, $this->loadDataLock, $this->optLocal, $textStringFilesystem, $this->optDuplicate, $this->tableIdent, $this->optUsePartition, $this->optLoadDataCharset, $this->optXmlRowsIdentifiedBy, $this->optFieldTerm, $this->optLineTerm, $this->optIgnoreLines, $this->optFieldOrVarSpec, $this->optLoadDataSetSpec, $this->comments);
128    }
129
130    /**
131     * Returns a copy with a new optDuplicate, preserving every other field.
132     */
133    public function withOptDuplicate(\SqlSemantics\Statement\Model\MySql\Role\OptDuplicateForm $optDuplicate): self
134    {
135        return new self($this->dataOrXml, $this->loadDataLock, $this->optLocal, $this->textStringFilesystem, $optDuplicate, $this->tableIdent, $this->optUsePartition, $this->optLoadDataCharset, $this->optXmlRowsIdentifiedBy, $this->optFieldTerm, $this->optLineTerm, $this->optIgnoreLines, $this->optFieldOrVarSpec, $this->optLoadDataSetSpec, $this->comments);
136    }
137
138    /**
139     * Returns a copy with a new tableIdent, preserving every other field.
140     */
141    public function withTableIdent(\SqlSemantics\Statement\Model\MySql\Role\TableIdentForm $tableIdent): self
142    {
143        return new self($this->dataOrXml, $this->loadDataLock, $this->optLocal, $this->textStringFilesystem, $this->optDuplicate, $tableIdent, $this->optUsePartition, $this->optLoadDataCharset, $this->optXmlRowsIdentifiedBy, $this->optFieldTerm, $this->optLineTerm, $this->optIgnoreLines, $this->optFieldOrVarSpec, $this->optLoadDataSetSpec, $this->comments);
144    }
145
146    /**
147     * Returns a copy with a new optUsePartition, preserving every other field.
148     */
149    public function withOptUsePartition(\SqlSemantics\Statement\Model\MySql\Role\OptUsePartitionForm $optUsePartition): self
150    {
151        return new self($this->dataOrXml, $this->loadDataLock, $this->optLocal, $this->textStringFilesystem, $this->optDuplicate, $this->tableIdent, $optUsePartition, $this->optLoadDataCharset, $this->optXmlRowsIdentifiedBy, $this->optFieldTerm, $this->optLineTerm, $this->optIgnoreLines, $this->optFieldOrVarSpec, $this->optLoadDataSetSpec, $this->comments);
152    }
153
154    /**
155     * Returns a copy with a new optLoadDataCharset, preserving every other field.
156     */
157    public function withOptLoadDataCharset(\SqlSemantics\Statement\Model\MySql\Role\OptLoadDataCharsetForm $optLoadDataCharset): self
158    {
159        return new self($this->dataOrXml, $this->loadDataLock, $this->optLocal, $this->textStringFilesystem, $this->optDuplicate, $this->tableIdent, $this->optUsePartition, $optLoadDataCharset, $this->optXmlRowsIdentifiedBy, $this->optFieldTerm, $this->optLineTerm, $this->optIgnoreLines, $this->optFieldOrVarSpec, $this->optLoadDataSetSpec, $this->comments);
160    }
161
162    /**
163     * Returns a copy with a new optXmlRowsIdentifiedBy, preserving every other field.
164     */
165    public function withOptXmlRowsIdentifiedBy(\SqlSemantics\Statement\Model\MySql\Role\OptXmlRowsIdentifiedByForm $optXmlRowsIdentifiedBy): self
166    {
167        return new self($this->dataOrXml, $this->loadDataLock, $this->optLocal, $this->textStringFilesystem, $this->optDuplicate, $this->tableIdent, $this->optUsePartition, $this->optLoadDataCharset, $optXmlRowsIdentifiedBy, $this->optFieldTerm, $this->optLineTerm, $this->optIgnoreLines, $this->optFieldOrVarSpec, $this->optLoadDataSetSpec, $this->comments);
168    }
169
170    /**
171     * Returns a copy with a new optFieldTerm, preserving every other field.
172     */
173    public function withOptFieldTerm(\SqlSemantics\Statement\Model\MySql\Role\OptFieldTermForm $optFieldTerm): self
174    {
175        return new self($this->dataOrXml, $this->loadDataLock, $this->optLocal, $this->textStringFilesystem, $this->optDuplicate, $this->tableIdent, $this->optUsePartition, $this->optLoadDataCharset, $this->optXmlRowsIdentifiedBy, $optFieldTerm, $this->optLineTerm, $this->optIgnoreLines, $this->optFieldOrVarSpec, $this->optLoadDataSetSpec, $this->comments);
176    }
177
178    /**
179     * Returns a copy with a new optLineTerm, preserving every other field.
180     */
181    public function withOptLineTerm(\SqlSemantics\Statement\Model\MySql\Role\OptLineTermForm $optLineTerm): self
182    {
183        return new self($this->dataOrXml, $this->loadDataLock, $this->optLocal, $this->textStringFilesystem, $this->optDuplicate, $this->tableIdent, $this->optUsePartition, $this->optLoadDataCharset, $this->optXmlRowsIdentifiedBy, $this->optFieldTerm, $optLineTerm, $this->optIgnoreLines, $this->optFieldOrVarSpec, $this->optLoadDataSetSpec, $this->comments);
184    }
185
186    /**
187     * Returns a copy with a new optIgnoreLines, preserving every other field.
188     */
189    public function withOptIgnoreLines(\SqlSemantics\Statement\Model\MySql\Role\OptIgnoreLinesForm $optIgnoreLines): self
190    {
191        return new self($this->dataOrXml, $this->loadDataLock, $this->optLocal, $this->textStringFilesystem, $this->optDuplicate, $this->tableIdent, $this->optUsePartition, $this->optLoadDataCharset, $this->optXmlRowsIdentifiedBy, $this->optFieldTerm, $this->optLineTerm, $optIgnoreLines, $this->optFieldOrVarSpec, $this->optLoadDataSetSpec, $this->comments);
192    }
193
194    /**
195     * Returns a copy with a new optFieldOrVarSpec, preserving every other field.
196     */
197    public function withOptFieldOrVarSpec(\SqlSemantics\Statement\Model\MySql\Role\OptFieldOrVarSpecForm $optFieldOrVarSpec): self
198    {
199        return new self($this->dataOrXml, $this->loadDataLock, $this->optLocal, $this->textStringFilesystem, $this->optDuplicate, $this->tableIdent, $this->optUsePartition, $this->optLoadDataCharset, $this->optXmlRowsIdentifiedBy, $this->optFieldTerm, $this->optLineTerm, $this->optIgnoreLines, $optFieldOrVarSpec, $this->optLoadDataSetSpec, $this->comments);
200    }
201
202    /**
203     * Returns a copy with a new optLoadDataSetSpec, preserving every other field.
204     */
205    public function withOptLoadDataSetSpec(\SqlSemantics\Statement\Model\MySql\Role\OptLoadDataSetSpecForm $optLoadDataSetSpec): self
206    {
207        return new self($this->dataOrXml, $this->loadDataLock, $this->optLocal, $this->textStringFilesystem, $this->optDuplicate, $this->tableIdent, $this->optUsePartition, $this->optLoadDataCharset, $this->optXmlRowsIdentifiedBy, $this->optFieldTerm, $this->optLineTerm, $this->optIgnoreLines, $this->optFieldOrVarSpec, $optLoadDataSetSpec, $this->comments);
208    }
209
210    /**
211     * Returns a copy with a new comments, preserving every other field.
212     */
213    public function withComments(\SqlSemantics\Statement\Comments $comments): self
214    {
215        return new self($this->dataOrXml, $this->loadDataLock, $this->optLocal, $this->textStringFilesystem, $this->optDuplicate, $this->tableIdent, $this->optUsePartition, $this->optLoadDataCharset, $this->optXmlRowsIdentifiedBy, $this->optFieldTerm, $this->optLineTerm, $this->optIgnoreLines, $this->optFieldOrVarSpec, $this->optLoadDataSetSpec, $comments);
216    }
217}
218