- How do I install survos/pixie-bundle in a Symfony application?
- Install it with Composer using composer require survos/pixie-bundle, then register the bundle in your bundle configuration if your app does not use Symfony Flex auto-registration. After installation you need to supply database connection settings through the bundle configuration so the Pixie service can be wired into the container. Check the repository README for the exact configuration key names and required environment variables.
- How do I configure the Pixie database connection in Symfony?
- Configuration is handled through bundle settings rather than a separate config file format, so Pixie's PDO connection can be wired to your existing database credentials. You typically point it at the same parameters your Doctrine connection already uses, which keeps a single source of truth for host, database name, user, and password. Once configured, the Pixie instance is available as a Symfony service and can be injected wherever you need it.
- Can I use Pixie and Doctrine together in the same Symfony project?
- Yes. The bundle is designed to work alongside Doctrine, and because it can reuse the same database parameters you avoid duplicating connection configuration. Pixie requires no entity mapping, so it is a good fit for reporting queries, legacy schemas, or quick ad hoc SQL while Doctrine continues to handle your mapped domain model. Both layers can share the same database without conflict.
- How do I inject the Pixie query builder into a controller or service?
- Because the bundle registers Pixie as a Symfony service, you can type-hint the Pixie class in a controller action or service constructor and let the container autowire it. If autowiring is disabled or you need multiple connections, reference the service id explicitly in your service definition. From there you call the fluent query builder methods directly, without a repository or entity manager in between.
- Does survos/pixie-bundle support Symfony 6 and Symfony 7?
- Symfony version support is declared in the bundle's composer.json, so check the require section there before upgrading your framework. Small bundles like this one usually track recent Symfony releases, but the authoritative answer is always the constraint list in the repository at the version you intend to install. Run composer why-not survos/pixie-bundle if Composer refuses to install it on your Symfony version.
- Is survos/pixie-bundle a Laravel package?
- No, it is a Symfony bundle that integrates the framework-agnostic Pixie query builder into a Symfony application through service configuration and dependency injection. If you are working in Laravel you would use the underlying Pixie library directly instead of this bundle, since Laravel's service container and configuration conventions differ. The query builder API itself is the same, only the integration layer changes.
- Do I need entities or migrations to use Pixie in Symfony?
- No entity mapping is required, which is the main reason to reach for this bundle on small projects or legacy schemas. Pixie works against tables and columns as they exist in the database, so you can query a schema you do not control without writing Doctrine metadata for it. Migrations remain useful for schema changes, but they are not a prerequisite for running queries.
- How does Pixie compare to Doctrine DBAL or raw PDO for reporting queries?
- Pixie sits between raw PDO and DBAL: you get a chainable, fluent API for SELECT, INSERT, UPDATE, and DELETE without DBAL's larger surface area or Doctrine ORM's hydration and mapping machinery. For aggregate reports, dashboards, and one-off queries against unfamiliar tables this keeps the code short and readable. If you need advanced type handling, schema management, or platform portability, DBAL is the more complete choice.
- How do I test code that uses the Pixie service in Symfony?
- Treat the Pixie service like any other dependency: inject a stub or a real instance pointed at a dedicated test database in your KernelTestCase or WebTestCase setup. Because queries run directly against PDO, tests need an actual database schema rather than in-memory mocks of entities. Keep fixtures small and reset the test schema between runs so reporting queries return predictable results.
- Is Pixie fast enough for production use in a Symfony app?
- Pixie is intentionally lightweight, so query execution cost is dominated by your SQL and indexes rather than by the builder itself, and it avoids ORM overhead such as entity hydration and identity maps. That makes it a solid choice for read-heavy reporting endpoints and internal tools. For large domain models where you rely on lazy loading, unit of work, and second-level caching, Doctrine ORM remains the better fit.