Skip to content

SqlGenerator and the square brackets #13

@dbu

Description

@dbu

moved from phpcr/phpcr#21

When using the QOM, the user should not need to know about escaping in SQL2. But when you do something like the following you still need the brackets:

$qomFactory->fulltextSearch('title', 'The', '[nt:unstructured]');

Without square brackets jackrabbit throws:

HTTP 400: Query:
SELECT * FROM [nt:unstructured] WHERE CONTAINS(nt:(*)unstructured.title, 'Team') AND [phpcr:class] = 'Sandbox\MainBundle\Document\EditableStaticContent' ORDER BY path ASC; expected: ,

looking through this https://github.com/phpcr/phpcr-utils/blob/master/src/PHPCR/Util/QOM/Sql2Generator.php i see many places where a name without [] is created. maybe we need more validation too. QueryBuilder seems to expect namespaced names whereas Sql2Generator seems to have 2 parameters if i understand correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions