schemaGrammar)) { $this->useDefaultSchemaGrammar(); } return new FirebirdSchemaBuilder($this); } /** * Get the default schema grammar instance. * * @return \Firebird\Schema\Grammars\FirebirdGrammar */ protected function getDefaultSchemaGrammar() { return new FirebirdSchemaGrammar($this); // $this->withTablePrefix() } /** * Get a new query builder instance. * * @return \Firebird\Query\Builder */ public function query() { return new FirebirdQueryBuilder( $this, $this->getQueryGrammar(), $this->getPostProcessor() ); } /** * Run an insert statement against the database. * * @param string $query * @param array $bindings * @param string|null $sequence * @return bool */ public function insert($query, $bindings = [], $sequence = null) { return $this->run($query, $bindings, function ($query, $bindings) use ($sequence) { if ($this->pretending()) { return true; } $statement = $this->getPdo()->prepare($query); $this->bindValues($statement, $this->prepareBindings($bindings)); $this->recordsHaveBeenModified(); $result = $statement->execute(); // Fetch the RETURNING clause result to get the actual ID used if ($result) { $row = $statement->fetch(\PDO::FETCH_ASSOC); if ($row) { // Get the first (and typically only) returned value $this->lastInsertId = reset($row); } } return $result; }); } /** * Execute a stored procedure. * * @param string $procedure * @param array $values * @return Collection */ public function executeProcedure($procedure, array $values = []): Collection { return $this->query()->fromProcedure($procedure, $values)->get(); } }