Feature #24013
openFirebird and RedDatabase support
Added by Andrey Lobanov (RedSoft) almost 8 years ago. Updated about 2 years ago.
0%
Description
I made a patch that adds support for firebird and RedDatabase(based on firebird).
Biggest problem that occurs when trying to run redmine with activerecord-fb-adapter that redmine uses in string constants firebird keywords.
Files
Updated by Toshi MARUYAMA almost 8 years ago
It is too hard to see difference in patch.
Could you split patch to two patches?
- only indent and white space change
- main change
Updated by Andrey Lobanov (RedSoft) almost 8 years ago
- File Fb_Support_clear.patch Fb_Support_clear.patch added
Here is clear patch. These small changes allows redmine work with firebird.
Updated by Toshi MARUYAMA almost 8 years ago
Did you run tests and confirm other databases do not break tests?
http://www.redmine.org/builds/index.html
Updated by Andrey Lobanov (RedSoft) almost 8 years ago
I'm sorry few tests failed. So i'll fix it and upload only fully working patch.
Updated by Andrey Lobanov (RedSoft) almost 8 years ago
New version of patch. Other dbs tests working.
Updated by Toshi MARUYAMA almost 8 years ago
From blog written in Japanese:
http://qiita.com/jnchito/items/630b9f038c87298b5756
https://github.com/rails/rails/issues/16978#issuecomment-56211310
First thing,
arel_table
is private API of Rails and should not be used in applications.
http://bikeshed.fm/74#comment-2830227073
In this podcast I heard Arel is going to be a public API in Rails 5.1, correct? Does that mean Rails developers will be allowed to use it in applications?
I got an answer from Sean:
Yes, it will be stable after 5.1
https://twitter.com/sgrif/status/763830491204026368
Updated by Toshi MARUYAMA almost 8 years ago
- Tracker changed from Patch to Feature
- Priority changed from Normal to Low
Updated by Andrey Lobanov (RedSoft) almost 8 years ago
Oh. I'll change arel_table usage.
Updated by Andrey Lobanov (RedSoft) almost 8 years ago
Fixed arel_table usage.
Updated by Mischa The Evil almost 8 years ago
- Upstream (activerecord-fb-adapter) issue: https://github.com/rowland/activerecord-fb-adapter/issues/70 (Problem with db migration)
- Upstream pull request: https://github.com/rowland/activerecord-fb-adapter/pull/73 (Redmine support)
Note from quick visual patch scan: it seems it is missing adaptations to the Gemfile
, the configuration stubs (config/database.yml.example) and the documentation (doc/INSTALL) reflecting the proposed extension of DB support.
Updated by Warren Postma almost 8 years ago
Given that Firebird is an extremely limited and feature-poor alternative to MySQL or Postgres, who would want to use Firebird? I say this as a person with 10 years professional Firebird (and Interbase) experience.
Firebird is itself an open source fork of the Borland/Embarcadero Interbase product.
Updated by Andrey Lobanov (RedSoft) almost 8 years ago
Warren Postma wrote:
Given that Firebird is an extremely limited and feature-poor alternative to MySQL or Postgres, who would want to use Firebird? I say this as a person with 10 years professional Firebird (and Interbase) experience.
Firebird is itself an open source fork of the Borland/Embarcadero Interbase product.
I'm sorry but when Firebird became feature-poor? Did you checked latest version 3.0?
Updated by Toshi MARUYAMA over 7 years ago
- File issue-24103-r16009-misc.diff added
- File issue-24103-r16009-keywords.diff added
- File issue-24103-r16009-db-migrate.diff added
These are patches which remained Firebird_support_v3.patch after r16008 and r16009.
I think issue-24013-r16009-db-migrate.diff breaks existing system.
Updated by Toshi MARUYAMA over 7 years ago
- File issue-24013-r16009-db-migrate.diff issue-24013-r16009-db-migrate.diff added
- File issue-24013-r16009-misc.diff issue-24013-r16009-misc.diff added
- File issue-24013-r16009-keywords.diff issue-24013-r16009-keywords.diff added
Fixed issue number of patch files.
Updated by Toshi MARUYAMA over 7 years ago
- File deleted (
issue-24103-r16009-keywords.diff)
Updated by Toshi MARUYAMA over 7 years ago
- File deleted (
issue-24103-r16009-misc.diff)
Updated by Toshi MARUYAMA over 7 years ago
- File deleted (
issue-24103-r16009-db-migrate.diff)
Updated by Andrey Lobanov (RedSoft) over 7 years ago
Right now i'm trying to find better solution to support Firebird.
The biggest problem to make it looks native. Because of large count of hardcoded queries with Firebird's keywords.
Updated by Andrey Lobanov (RedSoft) over 7 years ago
Example of queries changes to fit firebird:
Before:
JournalDetail.
where(["property = 'attr' AND prop_key = 'assigned_to_id' AND value = ?", id.to_s]).
update_all(['value = ?', substitute.id.to_s])
After:
JournalDetail.
where(:property => 'attr', :prop_key => 'assigned_to_id', :value => id.to_s).
update_all(:value => substitute.id.to_s)
Main problem is subqueries or part of queries(where, select, etc) like this:
# Returns a JOIN clause that is added to the query when sorting by custom values def join_for_order_statement(custom_field) alias_name = join_alias(custom_field) "LEFT OUTER JOIN #{CustomValue.table_name} #{alias_name}" + " ON #{alias_name}.customized_type = '#{custom_field.class.customized_class.base_class.name}'" + " AND #{alias_name}.customized_id = #{custom_field.class.customized_class.table_name}.id" + " AND #{alias_name}.custom_field_id = #{custom_field.id}" + " AND (#{custom_field.visibility_by_project_condition})" + " AND #{alias_name}.value <> ''" + " AND #{alias_name}.id = (SELECT max(#{alias_name}_2.id) FROM #{CustomValue.table_name} #{alias_name}_2" + " WHERE #{alias_name}_2.customized_type = #{alias_name}.customized_type" + " AND #{alias_name}_2.customized_id = #{alias_name}.customized_id" + " AND #{alias_name}_2.custom_field_id = #{alias_name}.custom_field_id)" end
In this code fragment i can't find good solution to replace
#{alias_name}.value
Any suggestions? I'll appreciate any help
Updated by Andrey Lobanov (RedSoft) over 7 years ago
- File current_trunk_Firebird_and_RedDatabase_support.patch current_trunk_Firebird_and_RedDatabase_support.patch added
Here changes to support firebird at actual trunk.
Updated by Andrey Lobanov (RedSoft) over 7 years ago
Also decimal precision fix
Updated by Andrey Lobanov (RedSoft) over 7 years ago
I think i forgot about some migration files. But i'll fix that later.
Updated by Andrey Lobanov (RedSoft) over 7 years ago
- File Symbols_instead_of_strings_to_support_firebird_keywords.patch Symbols_instead_of_strings_to_support_firebird_keywords.patch added
Here some fixes to use symbols instead of strings.
Updated by Andrey Lobanov (RedSoft) over 7 years ago
- File Value_keyword_replaced_with_symbols__in_application_controller.patch Value_keyword_replaced_with_symbols__in_application_controller.patch added
Value keyword replaced in application_controller
Updated by Lucas Schatz almost 5 years ago
Any news about this patch? is it stable? integrated?
It would be nice to use Firebird with Redmine too :)
Thanks!
Updated by Tim Crawford about 2 years ago
Warren Postma wrote:
Given that Firebird is an extremely limited and feature-poor alternative to MySQL or Postgres, who would want to use Firebird? I say this as a person with 10 years professional Firebird (and Interbase) experience.
Firebird is itself an open source fork of the Borland/Embarcadero Interbase product.
Just saw this. What?
Firebird is far better than MySql, especially for small systems.
MySql download alone is over 600 MB and takes about 30 minutes minumum to install
Firebird is 15 MB and can be installed in under 5 minutes
I says this as a person who worked for Oracle for 17 years,
and 7 years working with MySql and Firebird