Code Monkey home page Code Monkey logo

sql-to-mongo's People

Contributors

andrscyv avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

pyfundation

sql-to-mongo's Issues

p2m.config.json

  • user can write all cli params and sql and mongo connection params to a json file

Dry run

Abstract mongo driver to WriterClass that has methods:

  • writer.init()
  • -writer.write(collectionName, opts, rows)
  • -wirter.destroy()
    and implement MongoWriter ConsoleWriter

load writer in Exporter class

Make faster

Right now everything runs in serial, maybe theres oportunity for paralel procesing

Parse cli args

  • -d --dir : path to folder with export defs
  • -f --files : list of file paths of export def
  • -a -after-all: path to afterAll.js file
  • --dry-run: instead of writing to mongo, console.log what whould be written ( in format that could be piped to .json)
  • -c --cursor-size: default 2000

AfterAll

Hook to run arbitrary mongo commands after all exports have run succesfully

If exports specified from dir (--dir) then afterAll should be default export of afterAll.js

the path the the file can also be specifiec with -a --afterAll arg

default export should have signature : afterAll(db) , where db is mongo driver pointing to specified dbname

BeforeAll

Hook to run arbitrary mongo queries before running exports. Mainly to clean collections if necesarry

it should be specified as AfterAll hook

Reader

Abstart sql into ExportReader class and move al opts logic to main function, there all objects should get initialized and opts shoudlnt leak into other logic

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.