aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb
diff options
context:
space:
mode:
authorÉtienne Barrié <etienne.barrie@gmail.com>2010-05-16 18:50:25 +0200
committerJeremy Kemper <jeremy@bitsweat.net>2010-05-18 10:55:41 -0700
commit3809c80cd55ac2838f050346800889b6f8e041ef (patch)
tree220fa9b645e29e4a31c166ba813bb14e39fd33b9 /activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb
parentd3e62fc57ce3a0a1df62359f53d217d434c2d2e6 (diff)
downloadrails-3809c80cd55ac2838f050346800889b6f8e041ef.tar.gz
rails-3809c80cd55ac2838f050346800889b6f8e041ef.tar.bz2
rails-3809c80cd55ac2838f050346800889b6f8e041ef.zip
make add_index and remove_index more resilient; new rename_index method; track database limits
[#3452 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb57
1 files changed, 57 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb
new file mode 100644
index 0000000000..4118ea7b31
--- /dev/null
+++ b/activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb
@@ -0,0 +1,57 @@
+module ActiveRecord
+ module ConnectionAdapters # :nodoc:
+ module DatabaseLimits
+
+ # the maximum length of a table alias
+ def table_alias_length
+ 255
+ end
+
+ # the maximum length of a column name
+ def column_name_length
+ 64
+ end
+
+ # the maximum length of a table name
+ def table_name_length
+ 64
+ end
+
+ # the maximum length of an index name
+ def index_name_length
+ 64
+ end
+
+ # the maximum number of columns per table
+ def columns_per_table
+ 1024
+ end
+
+ # the maximum number of indexes per table
+ def indexes_per_table
+ 16
+ end
+
+ # the maximum number of columns in a multicolumn index
+ def columns_per_multicolumn_index
+ 16
+ end
+
+ # the maximum number of elements in an IN (x,y,z) clause
+ def in_clause_length
+ 65535
+ end
+
+ # the maximum length of a SQL query
+ def sql_query_length
+ 1048575
+ end
+
+ # maximum number of joins in a single query
+ def joins_per_query
+ 256
+ end
+
+ end
+ end
+end