RubyFlow The Ruby and Rails community linklog

Bitfields Rails Plugin/Gem, simple bitfields with scopes, sql, setter-sql, change-recording

The new ‘bitfields’ Rails plugin and gem allows simple bitfield managements for ActiveRecord and others, produces fast(indexable) sql for query and bit-setting.

Comments

You doing it all wrong. Idea of storing bitfields in single database field leads to very big problems in future grow of your database.

Does anyone know if we are limited to 32 bitfields per database column? Restriction based on 32bit integer (1, 2, 4, 8, 16…) obviously on 32bit OS….

… or am I getting it wrong?

Sergey, can you explain why this is wrong, and what the preferred way is? Or at least direct us to a link?

Bitfields are a good solution if a database already is huge, they save space and migrations(aka downtime) and can be renamed easily. With fast indexed IN() queries, query time should no longer be an issue.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in