Giter Site home page Giter Site logo

dialect's People

Contributors

danielnv18 avatar darrylkuhn avatar kblais avatar mfos239 avatar ravloony avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dialect's Issues

laravel5: take in account attribute casting

L5 eloquent models allows you to cast attributes:

protected $casts = [
    'is_admin' => 'boolean',
    'my_json_column' => 'array',
];

the idea is that your lib takes $casts values so you don't need to declare $jsonColumns in models

Migration file

How can I set data type as JSON while creating migration?

Why is Ardent required?

I was looking through the code, but I don't see what would require Ardent. Is that a mistake in the composer.json?

Laravel 5.1 issue

I have a problem installing on Laravel 5.1:

Your requirements could not be resolved to an installable set of packages.

Doesn't support Laravel 5.1?

Is there a way to define many to many (or any other than one to one) relationships?

Let's say I have table called employees, something like this:

CREATE TABLE employees
(
   id serial NOT NULL,
   name character varying(255) NOT NULL
)

With data like:
INSERT INTO employees (id, name) VALUES (1, 'john doe')
INSERT INTO employees (id, name) VALUES (2, 'john smith')

And a table called projects, something like this:

CREATE TABLE projects
(
   id serial NOT NULL,
   name character varying(255) NOT NULL,
   employees jsonb NOT NULL
)

Where employees is an array of employee IDs. Something like:
INSERT INTO projects (name, employees) VALUES ('cool new project', '[{employee_id: 1}, {employee_id: 2}]')

Is there a way to define a many to many relation in a similar way to one to one relation that would automatically load something like this using Project::with('projectEmployees')->find(1);;

{
  "id": 1,
  "name": "cool new project",
  "employees": [
    {"id": 1, "name" :"john doe"},
    {"id": 2, "name": "john smith"}
  ]
}

So basically, I'm trying replace a separate pivot table by using JSON data instead in the hope to keep database structure more simple and to have more flexible way to define relationship in a more NoSQL fashion. Do tell me if this is a bad idea to begin with, since I'm pretty new to Postgres and JSON datatypes and I've only really worked with MySQL and MongoDB before.

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.