Git Product home page Git Product logo

Comments (5)

27pchrisl avatar 27pchrisl commented on May 18, 2024

Thanks for the report @merouanekhalili, looks like I was getting tripped up by https://github.com/doctrine/dbal/blob/10df50f949c78c1f3666451470183ca01c4c4fa5/src/Schema/AbstractSchemaManager.php#L891 making the names lower case in the associative array. I have fixed this by not relying on that key being the correct name.

from lodata.

27pchrisl avatar 27pchrisl commented on May 18, 2024

I have released https://github.com/flat3/lodata/releases/tag/v3.0.2 with this change. Please re-open this issue if the problem is not solved for you.

from lodata.

merouanekhalili avatar merouanekhalili commented on May 18, 2024

Hi Chris,

Thanks for your help.

The new release fix only the discovery step, but when you try to get the data the generated SQL statment is not correct.
I got the below error :

{"@context":"http://127.0.0.1:8000/odata/$metadata#cities","value":[OData-error: {"code":"query_error","message":"The executed query returned an error: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "\"\nLINE 1: SELECT dimensions.\"DIM_CITIES\".ID` AS ID, dimensions."DIM_C...\n ^","target":null,"details":[],"innererror":{}}

Below the code to test :

dimensions."DIM_CITIES" definition

CREATE TABLE dimensions."DIM_CITIES" ( "ID" int4 NOT NULL, "NAME" varchar NULL, "LATITUDE" float4 NULL, "LONGTITUDE" float4 NULL, CONSTRAINT cities_pkey PRIMARY KEY ("ID") );

app\Providers\AppServiceProvider.php

`<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}

/**
 * Bootstrap any application services.
 *
 * @return void
 */
public function boot()
{
    $cityType = \Flat3\Lodata\EntityType::factory('city');
    $cityType->addDeclaredProperty('ID', \Flat3\Lodata\Type::int64());
    $cityType->addDeclaredProperty('NAME', \Flat3\Lodata\Type::string());
    $cityType->addDeclaredProperty('LATITUDE', \Flat3\Lodata\Type::double());
    $cityType->addDeclaredProperty('LONGTITUDE', \Flat3\Lodata\Type::double());
    $citySet = \Flat3\Lodata\Drivers\SQLEntitySet::factory('cities', $cityType)
        ->setTable('dimensions."DIM_CITIES"')
        ->discoverProperties();
    \Flat3\Lodata\Facades\Lodata::add($citySet);
}

}`

from lodata.

27pchrisl avatar 27pchrisl commented on May 18, 2024

Thanks for the repro code @merouanekhalili, I've released https://github.com/flat3/lodata/releases/tag/v3.0.4 with additional fixes and test cases for these issues.

from lodata.

merouanekhalili avatar merouanekhalili commented on May 18, 2024

The issue is fixed, thanks Chris for your help.

from lodata.

Related Issues (20)

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.