How to use the jsstore.COL_OPTION function in jsstore

To help you get started, we’ve selected a few jsstore examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ujjwalguptaofficial / idbstudio / src / dist / bundle.js View on Github external
};
        var employees = {
            name: 'Employees',
            columns: [
                new jsstore_1.Column('employeeId').options([jsstore_1.COL_OPTION.PrimaryKey, jsstore_1.COL_OPTION.AutoIncrement]),
                new jsstore_1.Column('lastName').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.String),
                new jsstore_1.Column('birthDate').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.DateTime),
                new jsstore_1.Column('photo').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.String),
                new jsstore_1.Column('notes').setDataType(jsstore_1.DATA_TYPE.String),
            ]
        };
        var order_details = {
            name: 'OrderDetails',
            columns: [
                new jsstore_1.Column('orderDetailId').options([jsstore_1.COL_OPTION.PrimaryKey, jsstore_1.COL_OPTION.AutoIncrement]),
                new jsstore_1.Column('orderId').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.Number),
                new jsstore_1.Column('productId').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.Number),
                new jsstore_1.Column('quantity').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.Number)
            ]
        };
        var orders = {
            name: 'Orders',
            columns: [
                new jsstore_1.Column('orderId').options([jsstore_1.COL_OPTION.PrimaryKey]),
                new jsstore_1.Column('customerId').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.Number),
                new jsstore_1.Column('employeeId').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.Number),
                new jsstore_1.Column('orderDate').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.DateTime),
                new jsstore_1.Column('shipperId').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.Number)
            ]
        };
        var products = {
            name: 'Products',
github ujjwalguptaofficial / idbstudio / src / dist / bundle.js View on Github external
DemoService.prototype.getDbSchema = function () {
        var customers = {
            name: 'Customers',
            columns: [
                new jsstore_1.Column('customerId').options([jsstore_1.COL_OPTION.PrimaryKey, jsstore_1.COL_OPTION.AutoIncrement]),
                new jsstore_1.Column('customerName').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.String),
                new jsstore_1.Column('contactName').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.String),
                new jsstore_1.Column('address').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.String),
                new jsstore_1.Column('city').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.String),
                new jsstore_1.Column('postalCode').setDataType(jsstore_1.DATA_TYPE.String),
                new jsstore_1.Column('country').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.String)
            ]
        };
        var categories = {
            name: 'Categories',
            columns: [
                new jsstore_1.Column('categoryId').options([jsstore_1.COL_OPTION.PrimaryKey, jsstore_1.COL_OPTION.AutoIncrement]),
                new jsstore_1.Column('categoryName').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.String),
                new jsstore_1.Column('description').options([jsstore_1.COL_OPTION.NotNull]).setDataType(jsstore_1.DATA_TYPE.String),
            ]
        };

jsstore

Harness the power of JsStore to streamline database operations in your web applications. With its SQL-like API, JsStore simplifies IndexedDB interactions, enabling developers to easily query, filter, and manipulate data with familiar syntax and efficiency

MIT
Latest version published 7 days ago

Package Health Score

78 / 100
Full package analysis