{"id":13850042,"url":"https://github.com/topofocus/active-orient","last_synced_at":"2025-07-12T21:32:50.983Z","repository":{"id":32794134,"uuid":"36386400","full_name":"topofocus/active-orient","owner":"topofocus","description":"Pure Ruby interface to OrientDB","archived":false,"fork":false,"pushed_at":"2023-08-01T10:04:15.000Z","size":1348,"stargazers_count":40,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-17T11:45:18.401Z","etag":null,"topics":["database","orientdb","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/topofocus.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-05-27T18:14:22.000Z","updated_at":"2023-10-04T00:21:37.000Z","dependencies_parsed_at":"2024-01-15T22:01:15.453Z","dependency_job_id":null,"html_url":"https://github.com/topofocus/active-orient","commit_stats":{"total_commits":453,"total_committers":5,"mean_commits":90.6,"dds":"0.39514348785871967","last_synced_commit":"262a694a98dfdf6dd371e0bc55f1490f8ebb771b"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topofocus%2Factive-orient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topofocus%2Factive-orient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topofocus%2Factive-orient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topofocus%2Factive-orient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/topofocus","download_url":"https://codeload.github.com/topofocus/active-orient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225839485,"owners_count":17532305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","orientdb","ruby"],"created_at":"2024-08-04T20:00:57.292Z","updated_at":"2024-11-22T03:30:39.650Z","avatar_url":"https://github.com/topofocus.png","language":"Ruby","readme":"# ActiveOrient\nUse OrientDB to persistently store Ruby-Objects and use database queries to manage even very large datasets.   \n**OrientDB Version 3 is required**,  OrientDB 3.1 is supported\n\n---\n**Status**\n\n* Gem Version  0.80 pushed on Dec. 22, 2020\n---\n### Quick Start\n\nYou need a ruby 2.6 / 2.7  Installation and a working OrientDB-Instance (Version 3.0.17 or above).\n\n- clone the project, \n - run bundle install ; bundle update, \n - update config/connect.yml,\n - create the documentation:\n ```\n   sdoc . -w2 -x spec -x example\n   ```\n   and point the browser to ~/active-orient/doc/index.htm\n   \n-  read the [Wiki](./../../wiki/Initialisation)\n - and start an irb-session by calling  \n```\ncd bin\n./active-orient-console t)est   # or d)develpoment, p)roduction environment as defined in config/connect.ym\n```\n\n### Philosophy\n\n\nOrientDB is a Multi-Model-Database. It shares the concept of Inheritance with OO-Languages, like Ruby. \n \nUpon initialization `ActiveOrient` reads the complete structure of the database, creates corresponding ruby-classes (including inheritance) and then loads user defined methods from the `Model Directory`. A separate schema definition is not neccesary. \n\n`ActiveOrient` queries the OrientDB-Database, provides a cache to speed things up and provides handy methods to simplify the work with OrientDB. Like Active-Record it represents the \"M\" Part of the MCV-Design-Pattern. There is explicit Namespace support. Its philosophie resembles the [Hanami Project](https://github.com/hanami/hanami). \n\n\n\n\n#### CRUD\nThe CRUD-Process (create, read = query, update and remove) is performed as\n```ruby\t\n    # create the class\n    V.create_class :m   # V is the base »vertex» class. M is a vertex-class.\n    # create a record\n    M.create name: 'Hugo', age: 46, interests: [ 'swimming', 'biking', 'reading' ]\n    # query the database\n    hugo = M.where( name: 'Hugo' ).first\n    # update the dataset\n    hugo.update father: M.create( name: \"Volker\", age: 76 )  # we create an internal link\n    hugo.father.name\t# --\u003e volker\n    # change array elements\n    hugo.interests \u003c\u003c \"dancing\"  # --\u003e [ 'swimming', 'biking', 'reading', 'dancing' ]\n    M.remove hugo \n    M.delete_class\t# removes the class from OrientDB and deletes the ruby-object-definition\n ```\n \n\n#### Active Model interface\n\nAs for ActiveRecord-Tables, the Model-class itself provides methods to inspect and filter datasets form the database.\n\n```ruby\n  M.all   \n  M.first\n  M.last\n  M.where town: 'Berlin'\n  M.like \"name =  G*\"\n\n  M.count where: { town: 'Berlin' }\n```\n»count« gets the number of datasets fulfilling the search-criteria. Any parameter defining a valid SQL-Query in Orientdb can be provided to the »count«, »where«, »first« and »last«-method.\n\nA »normal« Query is submitted via\n```ruby\n  M.query.projection( projection-parameter)\n\t  .distinct( some parameters)\n\t  .where( where-parameter)\n\t  .order( sorting-parameters )\n\t  .group_by( one grouping-parameter )\n\t  (...)\n\t .execute\n\n```\n\nTo update several records, a class-method »update« is provided.\n```ruby\n  M.update connected: false   \t# add a property »connected» to each record\n  M.update set:{ connected: true },  where: \"symbol containsText 'S'\" \n```\n\nGraph-support:\n\n```ruby\n  V.create_class :the_vertex\n  E.create_class :the_edge\n  vertex_1 = TheVertex.create  color: \"blue\"\n  vertex_2 = TheVertex.create  flower: \"rose\"\n  vertex_1.assign via: TheEdge, vertex: vertex_2, attributes: {:birthday =\u003e Date.today }\n```\nIt connects the vertices and assigns the attributes to the edge.\n\nTo query a graph,  SQL-like-Queries and Match-statements can be used (details in the [wiki](https://github.com/topofocus/active-orient/wiki)). \n\n#### Other Documents\n\n- [Rails 5-Integration](./rails.md)\n\n\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopofocus%2Factive-orient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftopofocus%2Factive-orient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopofocus%2Factive-orient/lists"}