sql icon indicating copy to clipboard operation
sql copied to clipboard

A delightful SQL ORM ☺️

Results 27 sql issues
Sort by recently updated
recently updated
newest added

Just an idea. ```crystal module Onyx::SQL macro restrict(t, model, &block) {% for exp in block.body.expressions %} {% unless exp.is_a?(Call) && exp.name == "getter" %} {% raise "Must be getter" %}...

idea

I guess it's pretty common to store URIs as strings in databases.

qol

Currently this code can raise in runtime with `NilAssertionError` if `user.id` is `nil`. ```crystal class Use schema users do pkey id : Int32 end end class Post schema posts do...

rfc
breaking

Related to https://github.com/onyxframework/onyx/issues/18.

qol

To be consistent with Query methods. May be a little tedious, though: ```crystal changeset = user.changeset changeset.set(updated_at: Time.now) ```

rfc
breaking

```crystal repo.exec(user.update(updated_at: Time.now)) ``` Doesn't work now, as `Model#update` requires `Changeset` argument.

enhancement

```crystal Onyx::SQL.exec(user.update(changeset.update(foo: "bar"))) ```

rfc
breaking

Useful to query `Onyx::SQL::Serializable` objects with built queries.

enhancement

Use-case – unknown structure JSON: ```crystal type payload : Hash(String, String), converter: PG::JSONB(Hash(String, String)) ``` Or unique enumerables as set: ```crystal type tags : Set(String), converter: PG::Set(String) ```

enhancement

I do have code which requires models to be sorted persistently in different places. Primary key could act as a comparator value, even if it's UUID. See https://github.com/crystal-lang/crystal/pull/6611.

idea