GithubHelp home page GithubHelp logo

pomm-symfony-bridge's People

Contributors

chanmix51 avatar mvrhov avatar pounard avatar sanpii avatar seblours avatar stood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pomm-symfony-bridge's Issues

Bridge requires Twig extension

When building an API, there is no need for Twig. It may be needed in the dev environment because of the profiler but in production, even though the profiler extension is not loaded, Pomm still requires the twig service to be present & configured.

When no twig configuration is set, Symfony throws the following exception

Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: 
The service "pomm.twig_extension" has a dependency on a non-existent service "twig.loader".

Explain queries with non-string parameter

$this->pomm['default']
            ->getModel('AppBundle\\Model\\Db\\PublicSchema\\TeleinfoModel')
            ->findWhere('created = $*', [new \DateTime('2014-02-17 22:05:06.566862')]);

Explain this query throw an error:

Catchable Fatal Error: Object of class DateTime could not be converted to string in vendor/pomm-project/foundation/sources/lib/Session/Connection.php line 401

Timeline

Add pomm in timeline of profiler

PropertyInfo does'nt handle array sub type (varchar[], text[], int[]...)

Hi,

It seems that the PropertyInfo TypeExtractor does not handle array subtype.

In a structure like the following

<?php
namespace App\Model\Test\PublicSchema\AutoStructure;
use PommProject\ModelManager\Model\RowStructure;
class Asset extends RowStructure
{
    public function __construct()
    {
        $this
            ->setRelation('public.asset')
            ->setPrimaryKey(['id'])
            ->addField('id', 'int4')
            ->addField('typedarray', 'text[]')
            ;
    }
}

With API Plateform, when I want to generate the swagger file with:
bin/console api:swagger:export --output=swagger_specification.json

It throws an error:

In FileLoader.php line 168:
                                                                                                                                                                       
  Invalid text[]  in . (which is being imported from "/var/www/config/routes/api_platform.yaml"). Make sure there is a loader supporting the "api_platform" type.  
                                                                                                                                                                       

In TypeExtractor.php line 93:
                  
  Invalid text[]  

After some digging, in TypeExtractor.php, the function getPommType() does not get the proper array subtype.

    private function getPommType(Session $session, $sql_type)
    {
        $pomm_types = $session->getPoolerForType('converter')
            ->getConverterHolder()
            ->getTypesWithConverterName();

        if (!isset($pomm_types[$sql_type])) {
            throw new \RuntimeException("Invalid $sql_type");
        }

        return $pomm_types[$sql_type];
    }

If I replace with the code below, it works as expected.

    private function getPommType(Session $session, $sql_type)
    {
        $pomm_type = $session
            ->getClientUsingPooler('converter', $sql_type)
        ;

        if (!isset($pomm_type)) {
            throw new \RuntimeException("Invalid $sql_type ");
        }

        return $pomm_type;
    }

It seems to be multiple path to get a converter, I don't know if this is the right thing to do.

Logo in the profiler

After this PR the icon in the profiler is Pomm logo.

I think it is important to chose a picto that illustrates in the more accurate way that is a database related profiler. I thought a Postgresql related logo would be nice, what do you think ?

Unexpected error in profiler template

Key "time_ms" for array with keys "sql, parameters, session_stamp" does not exist.

in vendor/pomm-project/pomm-symfony-bridge/views/Profiler/db.html.twig (line 54)

Symfony4 deprecation

User Deprecated: Implementing "Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface" without the "reset()" method is deprecated since version 3.4 and will be unsupported in 4.0 for class "PommProject\SymfonyBridge\DatabaseDataCollector".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.