dbal Questions
6
Solved
I'm using Doctrine 2 where I have multiple connections for DBAL. I have also multiple EntityManagers in ORM.
I need to be able to somehow autowire specific DBAL connection into other Symfony 3 se...
3
Solved
I'm using doctrine DBAL and have some problem with SQL query as result of a queryBuilder.
$builder = $this->getConnection()->getQueryBuilder();
$builder->select(['id','name','type'])
-&g...
7
Solved
I'd like to add my SSL cert and key files to Doctrine DBAL configuration but I don't see how to achieve that.
In PHP, I just have to write something like :
$databaseHandler = new \PDO(
'mysql:ho...
Pm asked 27/4, 2015 at 17:44
1
I have some Criteria and need to create INSERT query based on SELECT with that Criteria.
Query should be like this:
INSERT INTO mytable (field1, field2)
SELECT f1, f2
FROM mytable2
JOIN mytable3 ...
Umberto asked 10/3, 2016 at 17:34
6
Solved
In doctrine DBAL2 when I execute a query like this:
<?php
$connection = $this->getDatabaseConnection();
$sql = "SELECT page_url
FROM cms_user_page
WHERE site_id = :siteid
AND active = '1...
Coston asked 20/9, 2012 at 9:9
1
Solved
On some existing code I have the following statement (after a rather long query building exercise):
return $statement->fetchAll(
DBAL\FetchMode::CUSTOM_OBJECT,
PublishedLead::class
);
This wo...
Antinode asked 21/10, 2020 at 16:57
3
Solved
I'm still working on PHP unit tests for testing my symfony2 controllers. My test classes are derivations of WebTestCase and the tests are doing GET or POST requests to check if everything works fin...
Decide asked 8/5, 2014 at 9:15
12
Solved
I get an error like database operations using Symfony2.
SQLSTATE[HY000] [2002] Connection refused
parameters.yml
parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port...
3
I've got a basic codeset like this (inside a controller):
$sql = 'select * from someLargeTable limit 1000';
$em = $this->getDoctrine()->getManager();
$conn = $em->getConnection();
$statem...
Laveta asked 4/9, 2014 at 8:42
2
I have a fresh Symfony 2.8 installation, with doctrine and MySQL 5.6 stack.
After executing a doctrine:schema:update --force, i can see
Database schema updated successfully! "x" queries were execu...
Kalif asked 1/3, 2017 at 16:24
1
What do I gain if I use Doctrine's Database Abstraction Layer (DBAL) over simple PDO?
Isn't PDO supposed to be an abstraction layer itself? As far as I can tell, the only benefit I gain is the abi...
Karren asked 3/4, 2015 at 23:57
1
I have a schema sql file (with syntax error) including multiple queries for settings database
example.sql
CREATE TABLE IF NOT EXISTS `example` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` tex...
1
I have this simple example:
$names = ['a', 'b'];
$query = $dbConnection->createQueryBuilder();
$query->select('*')
->from('foo')
->where($query->expr()->in('name', $names));
p...
1
Solved
The following example shows some extract of an code example. Invoking the QueryBuilder of Doctrine DBAL is done twice there - once for executing a SELECT(*) statement and prior to that executing a ...
2
Solved
First of all, I just want to mention that this is not an "issue" at all. Deleting with Doctrine DBAL is not a problem and I am able to do it.
What I actually wanted to know is if there is way to d...
Abduce asked 10/7, 2015 at 10:1
2
Solved
I am getting the 'Cardinality Violation' error, for the following SQL:
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing
SELECT p.* FROM mod_products_products p
LEF...
Impress asked 13/6, 2016 at 9:39
2
DBAL Query Builder:
http://www.doctrine-project.org/api/dbal/2.3/class-Doctrine.DBAL.Query.QueryBuilder.html
ORM Query Builder:
http://www.doctrine-project.org/api/orm/2.3/class-Doctrine.ORM.Query...
Kurtkurth asked 30/4, 2016 at 20:17
2
Solved
Using the example docs, I was able to get a query like this to work.
SELECT
f.foo,
b.bar
FROM Foo f
LEFT JOIN Bar b
WHERE
f.foo = 20
AND b.bar IN ?
Using DBAL, this code returns results.
$resu...
Undesigning asked 8/5, 2014 at 18:25
2
1
I like the convenience methods for data manipulation queries $conn->insert() and $conn->update() in doctrine 2 DBAL because insert/update values can be held an passed as associative array. But how ...
Thrift asked 14/1, 2015 at 15:20
2
Solved
I'm trying to add the "enum" type to my symfony2 dbal connection, but I can't find a way to do it.
doctrine:
dbal:
mapping_types:
enum: string
default_connection: default
connections:
defaul...
Lisette asked 5/5, 2015 at 8:59
2
Solved
I am using symfony 2.6 (composer.json equal to its github repo) and I am trying to use the schema filter of DBAL.
in config.yml
# Doctrine Configuration
doctrine:
dbal:
schema_filter: ^sf2_
b...
Bashee asked 13/4, 2015 at 10:34
2
Solved
Trying to connect to my MySQL database via SSL, I have successfully established the connection from my webserver via ssh with the following command line:
mysql -h my.host.here --port=5454 -v --ssl...
Fraunhofer asked 26/9, 2013 at 22:46
1
I am working on a Symfony 2 project where each user have his own database. In my config.yml file I have a doctrine:dbal:orm set for a client but no connection properties because they are set at run...
1
Solved
I'm using Doctrine, which provides both ORM (object relational mapping) and DBAL (database abstraction layer).
What is difference between them?
How should one decide when to use which?
Jacie asked 28/2, 2013 at 4:42
1 Next >
© 2022 - 2024 — McMap. All rights reserved.