Skip to content

Changlog after Gem 0.79

Hartmut Bischoff edited this page Dec 20, 2020 · 23 revisions
  • OrientQuery: Arguments can be chained
  • OrientQuery: (Match-Syntax) methods connect and statement return an OrientQuery-Object instead of a Matchstatement.
  • Delete: Model#delete, Vertex#delete all: true is required to delete any record (without where cause)
  SomeClass.delete all: true   # leads to an empty class
  • Edge.create: To put attributes (properties) to the edge, the keyword »set« is used. We are following the syntax of OrientDB#CreateEdge. As for Vertex#Create, the keyword :set is optional.
  • ORD.create_vertex, ORD.create_edge (file: class_utils.rb):: removed in favor of Vertex.create and Edge.create
  • ActiveOrient::Model Objects respond to to_human, which is alias by to_s
  • Vertex.edges selects adjacent edges by /pattern/ or by EDGE_CLASS. If a pattern is used, inheritance is respected. If a EDGE_CLASS is used, only edges of this particular class are selected.
  • Multiple connections supported
  • ORD.delete_class now correctly removes the database- and ruby-class
  • OrientQuery: Support for NULL values in queries:
  G.count( where: { abc: [nil] } )   # Array with nil element is translated into 'is NULL'
  G.update( set: {abc: nil} , where: 'something > 0' )  # Hash with nil-value translates to '= NULL'
  • Model.update!: the count of affected records is returned. (Where statement is not required) Document.update: The updated record is returned (unchanged) Model.update: A list of updated records is returned. (Where statement is required)
  • Monkey-Patching: Added »to_or« to any Object. The method aims the low level representation of the objects to the database. Its purpose: include any ruby-Object in a raw database query.
   "#56:0".expand.update{ "set karo = #{ass.to_or} " }
   # fires » update #56:0 set karo =  [ 3,4,5 ] return after $this «    
  • Unified initialization of queries through Model.query and Record.query. The queries are prebuild and then transmitted via .execute. This breaks the previous coding of Record.query( some query-code). It has to be changed as follows
  #old
  some_record.query( OrientSupport::OrientQuery.new( where:{ a:56 }) )
  #  to
  some_record.query( where: { a:56 } ).execute
  #  or
  some_record.query.where( a:56 ).execute
  • Vertex.modes supports :in, :out, and :both -edges and fires

    select outE().in, select inE().out, select both() queries

  • Multiple model-directories can be specified in ActiveOrient::Model.model_file and 'Model#preallocate' (see require_model_file in /model/the_class.rb)

  • The processing of Match-queries is separated from OrientQuery. Brief documentation in the wiki, Test-files included

Clone this wiki locally