1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/doc/TODO

102 lines
4.5 KiB
Text
Raw Normal View History

todo:
2008-05-21 03:23:32 -04:00
- joining with LIMIT is like aggregations!!
users.delete().where(
addresses.c.user_id==
select([users.c.id]).
where(users.c.name=='jack')
)
SELECT id, name,
(select count(*) FROM addresses WHERE
user_id=users.id)
FROM users
SELECT users.*, (SELECT count(id) FROM addresses WHERE
addresses.user_id=users.id) FROM users
2008-05-19 16:49:43 -04:00
- blocks for all operations
- result sets to attr correlation too
- cache expiry on write
- rewrite of arecord querycache test in light of this
2008-05-19 20:55:49 -04:00
- transactions
- scoped writes
2008-05-27 21:59:18 -04:00
- asc/desc for orderings
done:
2008-05-27 21:56:38 -04:00
- and/or w/ predicates
- mock out database
. Relation <=> Relation -> InnerJoinOperation
. Relation << Relation -> LeftOuterJoinOperation
. InnerJoinOperation.on(*Predicate) -> InnerJoinRelation
. LeftOuterJoinOperation.on(*Predicate) -> LeftOuterJoinRelation
. Relation[Symbol] -> Attribute
. Relation[Range] -> Relation
. Attribute == Attribute -> EqualityPredicate
. Attribute >= Attribute -> GreaterThanOrEqualToPredicate
. Relation.include?(Column) -> Predicate
2008-05-19 16:57:21 -04:00
. Relation.project(*Column) -> ProjectRelation
. Relation.select(*Predicate) -> SelectionRelation
. Relation.order(*Column) -> OrderRelation
. #to_sql
. Remove Builder
. Namespace
. Audit SqlAlchemy for missing features
- Generalized denormalizations on any aggregation (count, yes, but also max, min, average)
- Remove operator overloading of << and <=> for joins. Make it just foo.join(bar) and foo.outer_join(bar).
- Remove operator overloading of == for predicates. make it a.eq(b) (note lack of question mark).
- hookup more predicates (=, <=, =>)
- get some basic aggregations working: users.project(user[:points].max)
- Alias Table Names
- When joining with any sort of aggregation, it needs to be a nested select
- get a value select working: users.project(users[:name], addresses.select(addresses[:user_id] == users[:id]).project(addresses[:id].count))
- Session
- sublimate values to deal with the fact that they must be quoted per engine
- clean-up singleton monstrosity
- extract hashing module
- hash custom matcher
- make session engine stuff follow laws of demeter - currently doing some odd method chaining? rethink who is responsible for what
- session just calls execute, passing in a connection; by default it gets a connection from the relation.
2008-03-16 18:41:27 -04:00
- #formatter is now on value, attribute and relation; you must admit it's name is confusing given that e.g., relation already has a formatter (Sql::Relation) ... should it be called predicate formatter? operand1.to_sql(operand2.predicate) maybe prefer operand1.cast(operand2) or project or in light of
- renamed to #format: operand1.format(operand2)
2008-03-15 21:37:47 -04:00
- rename sql strategies
- need to_sql for ranges
- {:conditions=>{:id=>2..3}}
- nested orderings
- string passthrough
- conditions
- orderings
- relation inclusion when given an array (1,2,3,4) should quote the elements using the appropriate quoting formatter taken from the attribute
- descend on array, along with bind written in terms of it
2008-04-11 18:22:22 -04:00
- re-evaluate bind -- does bind belong inside the relation / predicate classes or in the factory methods?
- string passthrough:
:joins=>"INNER JOIN posts ON comments.post_id = posts.id"
2008-04-12 20:33:56 -04:00
- finish pending tests
- test relation, table reset
- test Value, in particular bind.
- test blank checks in relation.rb
2008-04-18 17:53:02 -04:00
- rename active_relation to arel
- fix complex joining cases:
- active record query adapter
- anonymous table names
2008-05-13 19:53:36 -04:00
- Explicitly model recursive structural decomposition / polymorphism
- Explicitly model the namer/externalizer using interpreter jargon
- All Sql Strategies should be accumulations with the top-level relation?
2008-05-17 23:24:22 -04:00
- instance methodify externalize
- test: find_attribute_given_attribute and all @attribute ||= everywhere and memoization of table class.
2008-05-19 16:57:21 -04:00
- rename select to where
- rename all ion classes
2008-04-11 18:22:22 -04:00
icebox:
- #bind in Attribute and Expression should be doing a descend?
- try to make aggegration testing in join spec to be a bit more unit-like
- standardize quoting
- use strings everywhere, not symbols ?
- "unit" test sql strategies
- use real world examples, so they should be like a tutorial.
- rename the tion (Selection) classes so that words that don't end in tion don't seem inconsistent
- consider this code from has_many:
# replace the SELECT clause with COUNT(*), preserving any hints within /* ... */
2008-05-13 19:53:36 -04:00
@reflection.options[:counter_sql] = @reflection.options[:finder_sql].sub(/SELECT (\/\*.*?\*\/ )?(.*)\bFROM\b/im) { "SELECT #{$1}COUNT(*) FROM" }
- lock
- SELECT suchandsuch FOR UPDATE