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

tdataset

v0.0.1

Published

Delphi TDataset for node.js

Downloads

2

Readme

TDataset for node.js

Delphi programming language is used in the class TDataSet. TDataSet class is the main class which controls all database operations. This class can be used with node.js so I wrote with JavaScript. Firebird support is available now.

Some of the advantages;

from the SELECT query, update and insert queries are automatically generated.

"Key Field" and "master table" in the query is parsed automatically.

According to the type of field value assignments and readings are performed.

Please report any errors in the opinions and requests.

My twitter

Installation

  npm install tdataset

Example

var db = require("tdataset");

var Db = new db.TServerConnection();
Db.DBName = "test";
Db.DBPort = "3050";
Db.DBUserName = "SYSDBA";
Db.DBServer = "localhost";
Db.DBPassword = "masterkey";

var Connection;

function returnQuery() {
    var Dst = new db.TServerDataSet();
    Dst.Params = undefined;
    Dst.Connection = Connection;
    Dst.SelectSQL = "SELECT * FROM CUSTOMERS";
    Dst.KeyFieldName = "ID";
    Dst.Open(false, 0, 0, function(Result, Err) {
        if (Result) {
            console.log("record count:"+Dst.RecordCount);
            console.log("field count:"+Dst.FieldsCount);
            console.log(Dst.Fields("ID").AsString);
            console.log(Dst.Fields(0).AsString);
            Dst.Edit();
            Dst.Fields("NAME").AsString = "Test";
            Dst.Post(function(Result, Err) {
                console.log("post complete.");

                Dst.Append(function(Result) {
                    Dst.Fields("NAME").AsString = "Test Append";
                    Dst.Post(function(Result, Err) {
                        console.log("append complete");
                    });
                });

            });
        }
    });
}

Db.Connect(function(Status, Db) {
    if (Status) {
        Connection = Db;
        returnQuery();
    }
    else console.log(Db);
});

Class help

TField

class represent Delphi TField class.

TField.Value()

this method return field value or set field value.

Returns: *, this method return field value or set field value.

TField.AsString()

this method return field value as string or set value from string.

Returns: string, this method return field value as string or set value from string.

TField.AsInteger()

this method return field value as integer or set value from integer.

Returns: integer, this method return field value as integer or set value from integer.

TField.AsDate()

this method return field value as date or set value from date.

Returns: date, this method return field value as date or set value from date.

TDataSet

represent from Delphi TDataSet

TDataSet.EOF()

if focused record is last record this method return true.

Returns: boolean, if focused record is last record this method return true.

TDataSet.BOF()

if focused record is first record this method return true.

Returns: boolean, if focused record is first record this method return true.

TDataSet.Rows()

this method get dataset rows.

Returns: TList, this method get dataset rows.

TDataSet.RecNo()

this method return focused record number.

Returns: integer, this method return focused record number.

TDataSet.RecordCount()

this method return record count.

Returns: integer, this method return record count.

TDataSet.FieldsCount()

this method return field count.

Returns: integer, this method return field count.

TDataSet.Fields(Field)

this method return TField passed field name or number. Example: TDataSet.Fields("ADI").AsString

Parameters

Field: integer | string, number or Field name.

Returns: {TField]

TDataSet.First()

this method focused first record in dataset.

TDataSet.Next()

this method focused next record in dataset.

TDataSet.Prior()

this method focused prior record in dataset.

TDataSet.Cancel()

this method cancel any changes in dataset. this method only run edit or insert mode.

TDataSet.Edit()

this method setting dataset mode to Editing

TDataSet.Locate(KeyField, Value)

this method search value in key field param.

Parameters

KeyField: string, name

Value: *, this method search value in key field param.

Returns: boolean, this method search value in key field param.

TDataSet.Close()

this method close dataset and free dataset memory.


TServerConnection

TServerConnection class. Main DB Connection class.

TServerConnection.Connect(OnResult)

Database connection method.

Parameters

OnResult: callback, connectionCallBack

TServerConnection.Append(OnResult)

This method add a new record in dataset.

Parameters

OnResult: callBack, nothing return any param.

TServerConnection.Delete(OnSuccess)

this method delete focused record in database.

Parameters

OnSuccess: callback, this callback return Result and Err params. Result params boolean, Err params string return value.

TServerConnection.Post(OnSuccess)

this method save record to database. this method only calling dataset mode editing or inserting.

Parameters

OnSuccess: callback, return Result boolean param and Err string param.

TServerConnection.ExecQuery(SQL, OnExecute)

this method onyl execute sql not return field or value. Example UPDATA T SET A = 1

Parameters

SQL: string, this method onyl execute sql not return field or value. Example UPDATA T SET A = 1

OnExecute: callback, this method onyl execute sql not return field or value. Example UPDATA T SET A = 1

TServerConnection.Open(Fetch, Skip, First, OnConnect)

This method open dataset and dataset mode setting browsing.

Parameters

Fetch: boolean, this param using fetching limit (limit sql command) setting the true.

Skip: integer, skip record size.

First: integer, first record size.

OnConnect: callback, global return callback.


Serkan KOCAMAN

Overview: Delphi TDataset represent for node.js

Version: 0.0.1