npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aios

v1.0.1

Published

Socket client for Aios server

Downloads

463

Readme

Socket client for aios server

The aios server is an in java implemeted lightweight server were currently different jdbc datasources can be registered and are accessible throw a socket connection. The exchanged messages an bson en-/decoded.

To use this package you need an aios server up and running.

Sources and documentation for the aios server can be found on https://github.com/thinkbaer/aios.

This is an experimantal implementation under active development don't use it on production systems!

Per default the aios server listens for socket connection on

  • host: localhost
  • port: 8118

Usage

Synchronized (with sockit-to-me)

Setup the server connection

var AiosServer = require('aios');

/**
 * Default implementation
 */
var server = new AiosServer({host:'localhost',port:8118});

// Sends the current timestamp and receives server time and duration
var response = server.ping();
/*
resonpse = {
	time: DateObject
	duration: long
}
*/

Register a JDBC datasource on aios server

// name for the datasource configuration
var dsn = 'hsql_test'

// necassary specification for datasource
var dsSpec = {
	type: 'jdbc',
	driver: 'org.hsqldb.jdbc.JDBCDriver',
	// if the driverLocation is remote then the driver will be downloaded by the server
	// a local driver path will be directly used 
	driverLocation: "http://central.maven.org/maven2/org/hsqldb/hsqldb/2.3.3/hsqldb-2.3.3.jar",
	url: "jdbc:hsqldb:file:/tmp/test_server/hsql_test",
	user: 'SA',
	password: ''
}

// register the datasource on aios server (needed only once)
var dataSource = server.dataSource(dsn, dsSpec);

// if the datasource is already registered, you can access the dataSource Object through
var sameDataSource = server.dataSource(dsn);

Query the registered datasource

var createDBSchema =[
    'CREATE TABLE  IF NOT EXISTS car ( id INTEGER IDENTITY, type VARCHAR(256), name VARCHAR(256))'
    "INSERT INTO car (type, name) VALUES('Ford', 'Mustang')",
    "INSERT INTO car (type, name) VALUES('Volkswagen', 'Golf')"
]

// like JDBC executeBatch 
// http://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html#executeBatch--
var results = ds.executeBatch(createDBSchema);

// like JDBC execute
// http://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html#execute--
results = ds.execute("INSERT INTO car (type, name) VALUES('Volvo', 'V70')");

// like JDBC executeUpdate
// http://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html#executeUpdate--
results = ds.update("INSERT INTO car (type, name) VALUES('Volvo', 'V70')");

// like JDBC executeQuery
// http://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html#executeQuery--
results = ds.query("SELECT * FROM car");
// returns an array with query results

Asynchron (with net.Socket)

Currently not implemented, coming soon ...

// TODO

Links

aios server

nodejs aios client


Work in progress ...

  • Error Handling
  • Connection pooling
  • Asynchon implementation
  • Performance optimization
  • Benchmarks