Git Product home page Git Product logo

fluent-fm's People

Contributors

annoyingtechnology avatar bnzo avatar dependabot-preview[bot] avatar serhiimakarov avatar thyyppa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fluent-fm's Issues

search criteria clearing

This is a great package I have used in several projects. Thank you for making it available. I have an issue in one of my projects related to search criteria across multiple uses. As far as I can tell in the documentation, there is no way to clear existing search criteria in a persistent connection. I am using a singleton model where I instantiate the connection in the constructor and use the same instance across several queries and updates throughout my job. The problem is when I try to search for the same foreign key in two different fields. In this use case, I have actual parent with child records. The data model has two foreign key fields, one for the father and one for the mother. I do not always have a 'gender' to use as a qualifier for the search. So I am using a standard try catch to first check for child records where the parent is in the mother fk field. Then do the same for the father fk field position. What I see in the logs is that the search criteria value is persisted from the mother search when the father search is executed. So I never get a correct return from my attempts to search for the father because it is searching for records that have a parent pk in both the father fk and mother fk fields. This breaks down in many other places later on, but in all cases it is related to search criteria persisting after execution. If I am somehow using this incorrectly, please let me know.

Delete with non-id conditions throws an exception if they don't match any record

Doing on delete with anything but the id as conditions will throw a 400 Bad Request when the conditions don't match any record.

This is due to $this->find($layout)->get() L:265 returning nothing.
https://github.com/thyyppa/fluent-fm/blob/master/src/Connection/FluentFMRepository.php#L245

 public function delete(string $layout, int $recordId = null): FluentFM
    {
        $this->callback = function () use ($layout, $recordId) {
            $recordIds = $recordId ? [$recordId] : array_keys($this->find($layout)->get());

            foreach ($recordIds as $id) {
               // ...
            }
        };
    }

And $recordIds ending up as an empty array.
Then attempting to DELETE /layout/ without specifying an id which triggers a legitimate 400 from Filemaker.

I'll submit a PR.

auto_id should be editable

The auto_id field of the FluentFMRepository should be public or have a setter method so it can be set to false

In my use case the responsibility of setting the id lies with the database, so we do not want to set the id when creating a new dataset.

Run Script

Is it possible to run a script on its own (outside of a find) and have the script results returned?

Error when using where

Whenever the "where" function is used, it returns an error indicating that it does not find the field. Could you tell me how to fix it please?

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.