Git Product home page Git Product logo

mohomine's Introduction

MohoMine

To start your Phoenix app:

  1. Install dependencies with mix deps.get
  2. Create and migrate your database with mix ecto.create && mix ecto.migrate
  3. Start Phoenix endpoint with mix phoenix.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Learn more

Install ODBC for Firebird

First you have to install ODBC app for linux: sudo apt-get install odbcinst

Next you should download Linux ODBC drivers from firebirdsql.com. After extracting the tarball you should see a libOdbcFb.so file. Copy this to /usr/lib folder

Next install firebird (it can also be obtained from firebirdsql.com) by downloading the tarball and running ./install.sh. It will place the necessary files into /opt/firebird. Do the following:

  • sudo cp /opt/firebird/lib/libfbclient.so.x.y.z /usr/lib/libfbclient.so.x.y.z (where x, y and z are versioning numbers)
  • ln -s /usr/lib/libfbclient.so.x.y.z /usr/lib/libfbclient.so.x
  • ln -s /usr/lib/libfbclient.so.x /usr/lib/libfbclient.so

For legacy applications, this should also be done:

  • ln -s /usr/lib/libfbclient.so /usr/lib/libgds.so.0
  • ln -s /usr/lib/libfbclient.so /usr/lib/libgds.so

After this, add a similar config to /etc/odbcinst.ini

[Firebird]
Description    = Firebird driver
Driver         = /usr/lib/libOdbcFb.so

Now you are ready to connect to a Firebird database using the Firebird datasource defined in the /etc/odbcinst.ini file. Erlang has odbc by default so it makes sense to use it.

Add :odbc to mix.exs because it's a separate application that has to be started and stopped:

def application do
  [mod: {MohoMine, []},
   applications: [:phoenix, :phoenix_html, :cowboy, :logger,
				  :phoenix_ecto, :postgrex, :odbc]]
end

Try the following to connect:

{:ok, ref} = :odbc.connect('Driver=Firebird;Uid=SYSDBA;Pwd=[your_password];Server=localhost;Port=3050;Database=/path_to_db/db_file.fdb', [])
 ... do stuff
 :odbc.disconnect(ref)

mohomine's People

Contributors

szabolcsmaj avatar

Watchers

 avatar

mohomine's Issues

Implement filtering options for queries

Present the user with certain filtering options when he is viewing the dashboard.
The following might be made:

  • Filter for year
  • Filter for product types
  • Filter for providers. Filtering should be multi-selectable. Use select2 jquery plugin to implement this
  • Filter for agent names

Database collation shouldn't be hardcoded

Currently in lib/moho_mine/data_source/firebird.ex inside extract_query_results the method which transforms database strings should be database collation agnostic. The transformation call should be configurable based on the database and the collation.

(The function itself is quite shitty at this moment because it only deals with the fixed structure of the existing queries. But this is another matter)

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.