SQLiteConnection.php 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace Illuminate\Database;
  3. use Illuminate\Database\Schema\SQLiteBuilder;
  4. use Illuminate\Database\Query\Processors\SQLiteProcessor;
  5. use Doctrine\DBAL\Driver\PDOSqlite\Driver as DoctrineDriver;
  6. use Illuminate\Database\Query\Grammars\SQLiteGrammar as QueryGrammar;
  7. use Illuminate\Database\Schema\Grammars\SQLiteGrammar as SchemaGrammar;
  8. class SQLiteConnection extends Connection
  9. {
  10. /**
  11. * Get the default query grammar instance.
  12. *
  13. * @return \Illuminate\Database\Query\Grammars\SQLiteGrammar
  14. */
  15. protected function getDefaultQueryGrammar()
  16. {
  17. return $this->withTablePrefix(new QueryGrammar);
  18. }
  19. /**
  20. * Get a schema builder instance for the connection.
  21. *
  22. * @return \Illuminate\Database\Schema\SQLiteBuilder
  23. */
  24. public function getSchemaBuilder()
  25. {
  26. if (is_null($this->schemaGrammar)) {
  27. $this->useDefaultSchemaGrammar();
  28. }
  29. return new SQLiteBuilder($this);
  30. }
  31. /**
  32. * Get the default schema grammar instance.
  33. *
  34. * @return \Illuminate\Database\Schema\Grammars\SQLiteGrammar
  35. */
  36. protected function getDefaultSchemaGrammar()
  37. {
  38. return $this->withTablePrefix(new SchemaGrammar);
  39. }
  40. /**
  41. * Get the default post processor instance.
  42. *
  43. * @return \Illuminate\Database\Query\Processors\SQLiteProcessor
  44. */
  45. protected function getDefaultPostProcessor()
  46. {
  47. return new SQLiteProcessor;
  48. }
  49. /**
  50. * Get the Doctrine DBAL driver.
  51. *
  52. * @return \Doctrine\DBAL\Driver\PDOSqlite\Driver
  53. */
  54. protected function getDoctrineDriver()
  55. {
  56. return new DoctrineDriver;
  57. }
  58. }