janko / rodauth-rails

Rails integration for Rodauth authentication framework
https://github.com/jeremyevans/rodauth
MIT License
571 stars 40 forks source link

PG::UndefinedColumn: ERROR: column "email" does not exist. #108

Closed ianrandmckenzie closed 2 years ago

ianrandmckenzie commented 2 years ago

Hi there,

First off, thanks for making this. Quite nice to have an easy in to Rodauth as a Rails dev.

I am finally trying out Rodauth Rails and am using blind_index for the Account model. I'm running into an error that has already been mentioned here: https://github.com/ankane/blind_index/issues/10

I'm having a bit of a hard time tracking down whether or not the query being a string is true or not. I can't find any string queries, but I also don't know if I should be digging through the source code here, or in the rodauth repo itself.

Any help is appreciated, but I can post on Stack Overflow instead if needed.

Thanks!

Also: This is all the console is giving me for an error:

Sequel::DatabaseError (PG::UndefinedColumn: ERROR:  column "email" does not exist
LINE 1: SELECT * FROM "accounts" WHERE (("email" = 'hi@abc.ca') AND ...
                                         ^
):

app/misc/rodauth_app.rb:9:in `block in <class:RodauthApp>'
janko commented 2 years ago

Hi, Rodauth is using Sequel for query building, and blind_index gem seems to be patching Active Record's query builder, so that patch will never be called.

A path forward would probably be making blind_index gem Sequel-compatible, but in any case it doesn't seem to be an issue that can be fixed in rodauth-rails (or Rodauth or Sequel).

AlexeyMatskevich commented 1 year ago

blink_index alternative for sequel https://sequel.jeremyevans.net/rdoc-plugins/classes/Sequel/Plugins/ColumnEncryption.html