Giter Site home page Giter Site logo

falcon-core's People

Contributors

amilajack avatar bornap avatar ckee83 avatar emerzh avatar felipetoffolo1 avatar jooohhn avatar kas avatar krolow avatar luisrudge avatar marcbachmann avatar maxcnunes avatar tylerwasniowski avatar

Watchers

 avatar  avatar  avatar

Forkers

georgebarlow

falcon-core's Issues

PR: Manage Connections

  • Validation of connections
  • Encryption of passwords
  • Supporting persistence of meta keys

Ideal API

The API from sqlectron was pretty unorganized. Because falcon-core was a fork of it, we had to borrow its architecture. I think core has matured enough to the point where we can migrate away from sqlectron's API and move towards one of our own: one that's more object oriented and namespaced to allow for faster imports, which we need. To keep a lot of the lower level database specific logic out of the UI, this newer API for falcon-core should be higher level.

import { ConnectionPool, ConnectionManager } from 'falcon-core';
import { SqliteProvider } from 'falcon-core/sqlite';

const connetionManager = new ConnetionManager();
const pool = new ConnectionPool();
const provider = new SqliteProvider();

const dbConn = await provider.connect({
  database: 'demo.sqlite',
  readonly: true
});
connectionManager.add(dbConn.config);
pool.add(dbConn);

// Connect to a favorite connection
const [firstConnection] = await connectionManager.getAll();
firstConnection.connect();

Infra updates

  • lint-staged
  • fix eslint errors
  • disable flow type-errors plugin

Schema CRUD

https://www.sqlite.org/lang_altertable.html

screen shot 2018-04-11 at 2 28 55 pm

The sqlite docs actually discuss how to manipulate the schema. We should investigate this.

UPDATE: db browser uses this file to create and transform sqlite ast's

UPDATE: Make sure to take advantage of sqlite savepoints. Create a savepoint before making schema changes

Add rollup support

Add rollup to bundle all the code and the deps. This is much better than publishing the packages themselves

RFC: getSupportedFeatures()

The basic idea with this is that each provider can return a list of features it supports. ex:

connection.hasFeatures('views') // false

PR: on*Change methods

  • onTableChange: Define a callback to fire when a table is changed
  • onDatabaseChange: Define a callback to fire when a database is changed
type cbType = (dbName: string, tableName: string) => Promise<void>;
type onTableChange = (cb: cbType) => Promise<void>;
type onDatabaseChange = (cb: cbType) => Promise<void>;

Use cases:

  • re-render the graph on change of the database
  • let the UI define a callback to update the tables, schema definition, etc when a table changes

PR: Remove database requirement

The current API requires the database to be given as a configuration argument to falcon. Sometimes the user might not know the database of a given connection. This works for sqlite but it wont work for other database types, such as mysql which can have multiple databases.

Change all the methods in ProviderInterface to accept a database argument before the table

PR: Support for showing users and privileges

Many databases show details of users, each of which have certain privileges. We need to be able to expose users and their privileges through an API.

We can ignore this for sqlite but we'll eventually need to implement this for other databases

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

PR: Make errors throw

I forgot that es6 built-ins are extendable. Instead of returning an array of error messages, we can use try/catch by creating a class like this:

class FalconError extends Error {
  constructor(message, data) {
    super(message)
    this.data = data
  }
}

try {
  throw new FalconError('falcon err here', { foo: 'asdf' })
  console.log('asdf')
} catch(e) {
  console.log(e.data)
}

Migrate to independent service provider architecture

The current api requires all the service providers to be loaded when falcon-core is imported. falcon-core currently takes about an entire second to load. Each provider requires its own native dependency. For example, the SqliteProvider depends on sqlite3, which is a native dep. Webpack can't work with native deps yet so this really hurts our perf of importing native deps (which includes falcon-core). We should migrate to an api which allows users of falcon-core to import only the providers they need like so:

async function main() {
  const  { SqliteProvider } = import('falcon-core')
  const serverInfo = {...};
  const serverSession = db.createServer(SqliteProvider, serverInfo);
  const connection = await serverSession.createConnection('demo.sqlite');
  await connection.connect();
  const schema = await connection.getSchema('tracks');
}

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.