dev-master
9999999-dev https://github.com/unclecheese/silverstripe-superqueryA tool for running queries in the CMS
BSD-3-Clause
The Requires
by Uncle Cheese
orm sql silverstripe queries
Wallogit.com
2017 © Pedro Peláez
A tool for running queries in the CMS
The power of raw queries, with the elegance of the ORM., (*1)
, (*2)
$ composer require unclecheese/sivlerstripe-superquery, (*3)
Use the _('YourClassName') as a replacement for YourClassName::get(), and use Symfony's
expression language for the rest. (Spoiler: it's so dead simple, you already understand it)., (*4)
Examples:, (*5)
_('File').filter('Created:LessThan', '2015-01-01')_('Member').filter({'Email:PartialMatch': 'hotmail.com', 'Active': true}).sort('Created DESC')_('Event').filter('Approved', true).relation('Sponsors').sort('CompanyName ASC')_('Event').filter('Approved', false).removeAll()Click on the Columns... button in the footer to bring up a panel allowing you to customise the view., (*6)
Click on the export buttons to export the data in its current state in JSON or CSV., (*7)
Click Save... to give the query a name and store it in the "saved queries" dropdown., (*8)
The API is decoupled from the CMS, meaning the tool can be installed anywhere in your project., (*9)
Needless to say, running raw queries against your database is serious business. All actions are restricted to ADMIN., (*10)
The tool is built on ReactJS using the Webpack module builder. To do dev work:
* Run npm run start in the module root directory.
* Visit the admin/superquery URL directly in your browser. Navigating to it from with in the CMS will not properly load the dev server., (*11)
For realeases / Pull requests:
* Run npm run build from the module root directory., (*12)
Ring Uncle Cheese., (*13)
A tool for running queries in the CMS
BSD-3-Clause
orm sql silverstripe queries