Code Monkey home page Code Monkey logo

activecube's People

Contributors

astudnev avatar ivanov17andrey avatar stepanovit avatar wittyjudge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jbwl bunsdev

activecube's Issues

Run rake spec error

spec/spec_helper.rb config:

ActiveRecord::Base.configurations = HashWithIndifferentAccess.new(
    default: {
      adapter: 'clickhouse',
      host: 'localhost',
      port: 8123,
      database: 'test',
      username: 'default',
      password: nil
    }
  )

  ActiveRecord::Base.establish_connection(:default)
end

run "sudo rake spec"
return error:

Failures:

  1) Activecube context executes in context
     Failure/Error: ActiveRecord::MigrationContext.new(MIGRATIONS_PATH, ActiveRecord::Base.connection.schema_migration).up
     
     ArgumentError:
       wrong number of arguments (given 3, expected 2)
     # /var/lib/gems/3.0.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:260:in `initialize'
     # /var/lib/gems/3.0.0/bundler/gems/clickhouse-activerecord-7d638fee3548/lib/active_record/connection_adapters/clickhouse/schema_statements.rb:95:in `new'
     # /var/lib/gems/3.0.0/bundler/gems/clickhouse-activerecord-7d638fee3548/lib/active_record/connection_adapters/clickhouse/schema_statements.rb:95:in `create_table_definition'
     # /var/lib/gems/3.0.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:295:in `create_table'
     # /var/lib/gems/3.0.0/gems/activerecord-6.0.2.1/lib/active_record/schema_migration.rb:33:in `create_table'
     # /var/lib/gems/3.0.0/gems/activerecord-6.0.2.1/lib/active_record/migration.rb:1206:in `initialize'
     # /var/lib/gems/3.0.0/gems/activerecord-6.0.2.1/lib/active_record/migration.rb:1061:in `new'
     # /var/lib/gems/3.0.0/gems/activerecord-6.0.2.1/lib/active_record/migration.rb:1061:in `up'
     # ./spec/cases/activecube_spec.rb:3:in `block (2 levels) in <top (required)>'

undefined method `limit_by`

I am trying to apply a limit_by to my cube. I'm having a hard time figuring out the arguments to pass.
My dimension is called product_id, and I want to limit it to 10 results:

I tried:

cube = cube.limit_by(['product_id'],[10])
and
cube = cube.limit_by(['product_id',10])
Both fail with:
undefined method limit_by for #<Arel::SelectManager>

Looking at the source, I also tried
cube = cube.limit_by([{ each: ['productid'],limit: [10]}])
Which also fails with
undefined method limit_by for #<Arel::SelectManager>

Could you please give an example how to use the limit_by option?

undefined method `connected_to' for MyCube:Module

Hello, this is a very interesting project. Trying to implement it in my Rails 6 App isn't straightforward. Is there any other documentation than the Spec example? I am having a hard time making it work outside of the example app.

The specific problem I'm running into is:

undefined method connected_to' for MyCube:Module` when trying to query my cube. I'm not sure if my Cube class needs to be inside a module?

It would be great if you could extend the ReadMe to show the setup (what files go where) in a Rails app. Thank you for any help.

ORDER BY WITH FILL supported for date histogram queries?

I could not find an answer in the docs for this question - when I create a Query with ActiveCube for a date histogram, I would like to use the very convenient option to fill empty days in the result. Clickhouse offers this: https://clickhouse.com/docs/en/sql-reference/statements/select/order-by#order-by-expr-with-fill-modifier

Is it possible now to add WITH FILL to the Cube's ORDER BY statement? If not, I would like to request this feature.

Thank you for this great library!

Clarify Managing Connections in Readme

I am using this interesting project in a Rails app. But I'm not sure why the "Managing Connections" section in the Readme:
https://github.com/bitquery/activecube#managing-connections is necessary.
If I implement it like described it will hard-select the Cube's connection for my rails app and subsequent queries to another model using a different connection and / or database (i.e. with a MySQL connection) will fail with "Table does not exist".

The Cube query works without explicitly setting the connection because the connection is already determined in the cube's table via ActiveRecord - so I was wondering if I'm missing something important or why setting the connection is necessary as shown in the Readme.

Thank you for the help and clarification!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.