Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requires all drivers to be in projectfile #1

Closed
drujensen opened this issue Sep 7, 2015 · 1 comment
Closed

requires all drivers to be in projectfile #1

drujensen opened this issue Sep 7, 2015 · 1 comment

Comments

@drujensen
Copy link
Member

Find a way to only compile and include the adapters for the drivers that are included in the projectfile

@drujensen
Copy link
Member Author

I reversed the order of the required chain so you need to specify which adapter in your model. This allows the compilation of only the adapter needed.

crimson-knight added a commit that referenced this issue May 3, 2023
* Add a check to ensure created_at and updated_at are Time

If a column is named `created_at` or `updated_at` is not a type `Time?`, then the following occurs:

```There was a problem expanding macro 'macro_4801706624'

Code in lib/granite/src/granite/transactions.cr:82:5

 82 | {% if @type.instance_vars.select { |ivar| ivar.annotation(Granite::Column) }.map(&.name.stringify).includes? "created_at" %}
      ^
Called macro defined in lib/granite/src/granite/transactions.cr:82:5

 82 | {% if @type.instance_vars.select { |ivar| ivar.annotation(Granite::Column) }.map(&.name.stringify).includes? "created_at" %}

Which expanded to:

 > 1 |
 > 2 |       if mode == :create
 > 3 |         @created_at = time.at_beginning_of_second
                                  ^---------------------
```

this simply adds a type check.

* fix allowing enum columns

* ameba fixes

* fix build_find_by_clause for bool values

* minor update

* Fix issue where primary key can be pushed twice on create

* fix infinate recusion when searching with enum

* add retry to adapter base

* add retry to adapters

* minor update

* add support for querying with Array(UUID)

* format docs

* FIX: add converter to read_attribute

* Fix for type declaration in has_one

* Fix callback runs on #import

* more has_one fixes; fixes for through associations

* small formatting fixes

* fix passing primary_key to has_one

* Add to docs (#446)

* Quote fields in PG query assembler

* Created converter for PG Enums that are returned as bytes

* Quote table names in adapter methods only if not already quoted

* Check if table/column string has already been quoted

* Quote foreign key

* Quote fields in query assemblers

* added some docs

* Created converter for Postgres enum arrays

* Incorrect variable name

* Added target key to association collection for many relations type

* Added truncate function for postgres adapter

* Removed unrequired parameter

* Rogue value in log for truncate

* Added truncate method for models

* Add JsonString converter

* Must use chars to check string index equality

* add note for custom select macro

* removed some other commits

* removed changes from other pr

* removed work from other pr

* removed work from other pr

* removed commits from other pr

---------

Co-authored-by: ionica21 <[email protected]>

* add support for foreign key converters (#438)

Co-authored-by: Joakim Repomaa <[email protected]>

* fix build_find_by_clause for bool values (#455)

* Add context to RecordNotSaved/RecordNotDestroyed error messages (#452)

* Add a check to ensure created_at and updated_at are Time (#454)

If a column is named `created_at` or `updated_at` is not a type `Time?`, then the following occurs:

```There was a problem expanding macro 'macro_4801706624'

Code in lib/granite/src/granite/transactions.cr:82:5

 82 | {% if @type.instance_vars.select { |ivar| ivar.annotation(Granite::Column) }.map(&.name.stringify).includes? "created_at" %}
      ^
Called macro defined in lib/granite/src/granite/transactions.cr:82:5

 82 | {% if @type.instance_vars.select { |ivar| ivar.annotation(Granite::Column) }.map(&.name.stringify).includes? "created_at" %}

Which expanded to:

 > 1 |
 > 2 |       if mode == :create
 > 3 |         @created_at = time.at_beginning_of_second
                                  ^---------------------
```

this simply adds a type check.

* small formatting fixes

* fix passing primary_key to has_one

* fix spec: Granite no longer escapes strings, but passes them to the underlying adapter

* Fix yaml spec to ignore whitespaces

* working mysql spec tests

* spec updates

* add github workflows (#1)

* update docker to use crystal 1.8 and added github action
* fix workflow if statements
* split workflow into separate jobs for each database
* workflow: fix missing envs
* workflow: add psql db var
* attempt to use workflow services
* split tests by database to speed things up

* fix sql test

* comment out workflow schedule

* re-enable ameba

---------

Co-authored-by: Seth T <[email protected]>
Co-authored-by: Richard Howell-Peak <[email protected]>
Co-authored-by: ionica21 <[email protected]>
Co-authored-by: Joakim Repomaa <[email protected]>
Co-authored-by: Joakim Repomaa <[email protected]>
Co-authored-by: Aurélien Delogu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant