Giter VIP home page Giter VIP logo

ericcj / metabase-netsuite-driver Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 29 KB

Unofficial Netsuite SuiteAnalytics Connect JDBC Metabase Driver

Home Page: https://www.metabase.com/docs/latest/developers-guide/partner-and-community-drivers

License: GNU Affero General Public License v3.0

Clojure 100.00%
metabase metabase-driver netsuite netsuite-customisation netsuite-development netsuite-integration

metabase-netsuite-driver's Introduction

Installation

All you need you do is drop the netsuite.metabase-driver.jar (from the Assets of the latest release https://github.com/ericcj/metabase-netsuite-driver/releases/), netsuite JDBC NQjc.jar from https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_3994742720.html and oracle ojdbc8.jar (see https://www.metabase.com/docs/latest/databases/connections/oracle even if though it's unused just because we inherit that driver) in your /path/to/metabase/plugins/ directory.

Why

metabase/metabase#26251

Building the driver

Prereq: Install the Clojure CLI

Make sure you have the clojure CLI version 1.10.3.933 or newer installed; you can check this with clojure --version. Follow the instructions at https://clojure.org/guides/getting_started if you need to install a newer version.

Prereq: Download JDBC jar

You need ~/NetSuiteJDBCDrivers/NQjc.jar from above

Prereq: Configure paths in ~/.clojure/deps.edn

See https://github.com/metabase/sudoku-driver/blob/master/README.md#hacking-on-the-driver-locally

Build it

# Example for building the driver with bash or similar

# switch to the local checkout of the Metabase repo
cd /path/to/metabase/repo

# to create metabase/resources/modules/oracle.metabase-driver.jar
bin/build-drivers.sh

# get absolute path to the driver project directory
DRIVER_PATH=`readlink -f ~/metabase-netsuite-driver`

# Build driver. See explanation at https://github.com/metabase/sudoku-driver/blob/master/README.md#build-it-updated-for-build-script-changes-in-metabase-0460
clojure \
  -Sdeps "{:aliases {:netsuite {:extra-deps {com.metabase/netsuite-driver {:local/root \"$DRIVER_PATH\"}}}}}"  \
  -X:build:netsuite \
  build-drivers.build-driver/build-driver! \
  "{:driver :netsuite, :project-dir \"$DRIVER_PATH\", :target-dir \"$DRIVER_PATH/target\"}"

will create target/netsuite.metabase-driver.jar. Copy this file and NQjc.jar to /path/to/metabase/plugins/ and restart your server, and the driver will show up.

Testing

Sample driver stuff might work https://github.com/metabase/sample-driver#interactive-testing

e.g. this does work:

MB_NETSUITE_DRIVER_TEST_PLUGIN_MANIFEST_PATH=/path/to/metabase-netsuite-driver/resources/metabase-plugin.yaml clojure -M:dev:ee:ee-dev:drivers:drivers-dev:user:trace:deps-alpha:user/metabase-netsuite-driver:nrepl

metabase-netsuite-driver's People

Contributors

ericcj avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

metabase-netsuite-driver's Issues

Date Filters Incorrectly Compile

Oracles implementation uses NUMTODSINTERVAL and NUMTOYMINTERVAL to create relative dates. These methods are not implemented in netsuite's version, go figure.

Additionally fixed dates render like so

(SuiteAnalytics.salesInvoiced.trandate >= '2023-05-01T00:00-04:00[America/New_York]' )

I've been hacking away on the driver for the last 3 days trying to fix #4 and I've come to realize I am not competent in clojure. I'm happy to provide feedback or testing if needed.

EDIT:
Just wanted to add that month and quarter work correctly.

Oracle Implementation

fails to set timezone

i'm not sure if this causes a problem but this shows up in the log on setup (after which everything seems to work ok including dates)

[cafcbd9f-c827-4c71-84cb-34858ec9f720] 2022-11-09T12:01:02-05:00 ERROR metabase.driver.sql-jdbc.execute Failed to set timezone 'UTC' for :netsuite database
java.sql.SQLSyntaxErrorException: [NetSuite][SuiteAnalytics Connect JDBC Driver][OpenAccess SDK SQL Engine]Syntax Error in the SQL statement.[10104]

can't convert queries with "order by" into a metabase "model"

all making it a model does is nest it in SELECT * FROM () "source" but if orig query has an order by you get "ORDER BY clause is invalid in views, derived tables, and subqueries unless TOP is also specified". I tried changing both the orig and outer queries to "SELECT TOP 10" but it didn't help so would have to dive deeper into suiteql

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.