• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

TypeScript sqlite.SQLite类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中@ionic-native/sqlite.SQLite的典型用法代码示例。如果您正苦于以下问题:TypeScript SQLite类的具体用法?TypeScript SQLite怎么用?TypeScript SQLite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了SQLite类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: VALUES

                        objMs.forEach(itemM => { 
                            let sql = `INSERT INTO ` + TB_SQLITE.tb_health +
                            `(
                                healthid, healthname, detailhealth
                            ) VALUES(
                                ?, ?, ?
                            )`;
                            //console.log(sql);
    
                            let paramSql = [
                                itemM.healthid, itemM.healthname, itemM.detailhealth
                            ];
                            
                            this.db.create(ConectionDBName.connectionDB).then(
                            (connection: SQLiteObject) => {
                                connection.executeSql(sql, paramSql).then(
                                    (result) => {
                                        SQLiteHandle.recordBeWrite++;
                                        //console.log('==== Insert table tb_health successfully.');
                                    }
                                    , (error) => {
                                        console.log('!!!!!!!!!!!!!!!!!!!!!!!! ==> Insert table tb_health error. ' + error);
                                    }
                                )
                            }
                            , (error) => {
                                reject(error);
                            });

                        });
开发者ID:warozz,项目名称:D3VMobiz,代码行数:30,代码来源:health-service.ts


示例2: IN

            (res) => {

                let valArray: Array<string> = new Array<string>();
                
                objMs.forEach(itemM => { 
                    valArray.push("'" + itemM.quotationno + "'");
                });

                let sqlParameList: string = valArray.join(","); 
                
                let sql = "DELETE FROM " + TB_SQLITE.tb_quotationrider;
                sql += " WHERE quotationno IN (" + sqlParameList + ")";

                //console.log('SQL command = xxxxxxxxxxxxx ' + sql);

                this.db.create(ConectionDBName.connectionDB).then(
                    (connection: SQLiteObject) => {
                        connection.executeSql(sql, []).then(
                            (result) => {
                                //console.log("===== deleteByQuoNo Quotationrider success.");
                                resolve(res);
                            }
                            , (error) => {
                                console.log("!!!!!!!!!!!!!!!!!!!!!!!! ==> deleteByQuoNo ERROR Quotationrider " + error);
                                reject(error);
                            }
                        )
                    }
                    , (error) => {
                        console.log(error);
                        reject(error);
                    }
                )
               
            },
开发者ID:warozz,项目名称:D3VMobiz,代码行数:35,代码来源:quotationrider-service.ts


示例3: Number

                            objM.forEach(itemM => { 

                                let paramSql = [
                                    itemM.quotationno, itemM.customerid, itemM.ridertype, itemM.sum, itemM.premium,
                                    itemM.createdatetime, itemM.lastmodify, itemM.lastsync, itemM.agentid
                                ];
  
                                this.db.create(ConectionDBName.connectionDB).then(
                                    (connection: SQLiteObject) => {
                                        connection.executeSql(sql, paramSql).then(
                                            (result) => {
                                              let num: number = SQLiteHandle.recordBeWrite; 
                                              SQLiteHandle.recordBeWrite = Number(num + 1);
                                            }
                                            , (error) => {
                                                console.log('==== Insert table Quotationrider error. ' + itemM.agentid + error);
                                            }
                                        )
                                    }
                                    , (error) => {
                                        reject(error);
                                    }
                                ).catch((error) => {
                                    reject(error);
                                });
                            });
开发者ID:warozz,项目名称:D3VMobiz,代码行数:26,代码来源:quotationrider-service.ts


示例4: reject

                (res) => {
                    let objMs: Array<PlanTypeDetailM> = params; 
                    let paramSQL = [];

                    if (objMs != null && objMs.length > 0) {
                        paramSQL = [objMs[0].typecode];
                    }
                    else {
                        reject("[objM[0].typecode] is null");
                    }
                    
                    let sql = `DELETE FROM ` + TB_SQLITE.tb_plantypedetail + ` WHERE typecode=?`;
                    console.log(sql);

                    this.db.create(ConectionDBName.connectionDB).then(
                        (connection: SQLiteObject) => {
                            connection.executeSql(sql, paramSQL).then(
                                (result) => {
                                    //console.log("===== Delete tb_plantypedetail success.");
                                    resolve(res);
                                }
                                , (error) => {
                                    console.log("!!!!!!!!!!!!!!!!!!!!!!!! ==> Delete tb_plantypedetail error." + error + " : " + error.message);
                                    reject(error);
                                }
                            )
                        }
                        , (error) => {
                            console.log(error);
                            reject(error);
                        }
                    )
                },
开发者ID:warozz,项目名称:D3VMobiz,代码行数:33,代码来源:plantype-detail-service.ts


示例5: reject

                (res) => {
                    let riderDetailM: Array<RiderDetailM> = objMs;
                    let paramSQL = [];
                    let sql = `DELETE FROM ` + TB_SQLITE.tb_riderdetail + ` WHERE plancode=?`;

                    if (riderDetailM != null && riderDetailM.length > 0) {
                        paramSQL = [riderDetailM[0].plancode];
                    }
                    else {
                        reject("riderDetailM[0].plancode is null.");
                    }

                    console.log(sql);

                    this.db.create(ConectionDBName.connectionDB).then(
                        (connection: SQLiteObject) => {
                            connection.executeSql(sql, []).then(
                                (result) => {
                                    console.log("===== Delete tb_riderdetail success.");
                                    resolve(res);
                                }
                                , (error) => {
                                    console.log("===== Delete tb_riderdetail error." + error + " : " + error.message);
                                    reject(error);
                                }
                            )
                        }
                        , (error) => {
                            console.log(error);
                            reject(error);
                        }
                    )
                },
开发者ID:warozz,项目名称:D3VMobiz,代码行数:33,代码来源:riderdetail-service.ts


示例6: KEY

                () => {
                    this.db.create(ConectionDBName.connectionDB)
                        .then(
                        (connection: SQLiteObject) => {
                            let sql: string = `CREATE TABLE IF NOT EXISTS ` + TB_SQLITE.tb_packagecoverage2 + 
                            `(
                                plancode TEXT, pan TEXT, accdsum TEXT, gsum TEXT, lifesum TEXT,
                                rpsum TEXT, srsum TEXT, tr44sum TEXT,
                                PRIMARY KEY (plancode, pan)
                                );`;

                            connection.executeSql(sql, []).then(
                                (result) => {
                                    //console.log("Create table tb_packagecoverage2 successfully.");
                                    resolve(result);
                                }
                                , (error) => {
                                    console.log("!!!!!!!!!!!!!!!!!!!!!!!! ==> Create table tb_packagecoverage2 error." + JSON.stringify(error));
                                    console.log(error);
                                    reject(error);
                                }
                            )
                        }
                        , (error) => {
                            console.log(error);
                            reject(error);
                        }
                        ).catch((error) => {
                            console.log(error);
                            reject(error);
                        })
                }
开发者ID:warozz,项目名称:D3VMobiz,代码行数:32,代码来源:package-coverage2-servicel.ts


示例7: ResponseModel

                (res) => {

                    let responseM: ResponseModel = new ResponseModel();
                    let sql: string = "SELECT COUNT(*) as total FROM " + TB_SQLITE.tb_plantypedetail;

                    //console.log(sql);

                    this.db.create(ConectionDBName.connectionDB).then(
                        (connection: SQLiteObject) => {
                            connection.executeSql(sql, []).then(
                                (result) => {
                                   // console.log("===== Select count success size " + result.rows.length);
                                    responseM.size = result.rows.item(0).total;
                                    responseM.status = 0;
                                    resolve(responseM);
                                }
                                , (error) => {
                                    console.log("==> Select count tb_plantypedetail error " + JSON.stringify(error));
                                    reject(error);
                                }
                            )
                        }
                        , (error) => {
                            console.log(error);
                            reject(error);
                        }
                    )
                },
开发者ID:warozz,项目名称:D3VMobiz,代码行数:28,代码来源:plantype-detail-service.ts


示例8: KEY

                () => {
                    this.db.create(ConectionDBName.connectionDB)
                        .then(
                        (connection: SQLiteObject) => {

                            let sql: string = `CREATE TABLE IF NOT EXISTS ` + TB_SQLITE.tb_subdistrict +
                                `(
                                    id TEXT, name TEXT, amphur TEXT,
                                    PRIMARY KEY (id)
                                );`;
                            //console.log(sql);

                            connection.executeSql(sql, []).then(
                                (result) => {
                                   // console.log("==> Create table " + TB_SQLITE.tb_subdistrict + " successfully.");
                                    resolve(result);
                                }
                                , (error) => {
                                    console.log("==> Create table " + TB_SQLITE.tb_subdistrict + " error." + JSON.stringify(error));
                                    reject(error);
                                }
                            )
                        }
                        , (error) => {
                            console.log(error);
                            reject(error);
                        }
                        ).catch((error) => {
                            console.log(error);
                            reject(error); 
                        })
                }
开发者ID:warozz,项目名称:D3VMobiz,代码行数:32,代码来源:subdistrict-service.ts


示例9: KEY

                () => {
                    this.db.create(ConectionDBName.connectionDB)
                        .then(
                        (connection: SQLiteObject) => {
                            let sql: string = `CREATE TABLE IF NOT EXISTS ` + TB_SQLITE.tb_taxsumcondition + 
                            `(
                                plancode TEXT, sex TEXT, minage INTEGER, maxage INTEGER, minsum REAL,
                                maxsum REAL, age INTEGER, sum INTEGER,
                                PRIMARY KEY (plancode, sex, minage, maxage, minsum, maxsum)
                                );`;

                            connection.executeSql(sql, []).then(
                                (result) => {
                                    //console.log("Create table " + TB_SQLITE.tb_taxsumcondition + " successfully.");
                                    resolve(result);
                                }
                                , (error) => {
                                    console.log("!!!!!!!!!!!!!!!!!!!!!!!! ==> Create table tb_taxsumcondition error." + JSON.stringify(error));
                                    console.log(error);
                                    reject(error);
                                }
                            )
                        }
                        , (error) => {
                            console.log(error);
                            reject(error);
                        }
                        ).catch((error) => {
                            console.log(error);
                            reject(error);
                        })
                }
开发者ID:warozz,项目名称:D3VMobiz,代码行数:32,代码来源:tax-sumcondition-service.ts


示例10: Date

                (res) => {
                    try {
                        let sql = "UPDATE " + TB_SQLITE.tb_quotation;
                        sql += " SET ";
                        sql += "lastsync='" + DateUtil.date2str(new Date()) + "'";
                        //console.log(sql);

                        this.db.create(ConectionDBName.connectionDB).then(
                            (connection: SQLiteObject) => {
                                connection.executeSql(sql, []).then(
                                    (result) => {
                                        //console.log("===== Update LastSync tb_quatation success.");
                                        resolve(res);
                                    }
                                    , (error) => {
                                        console.log("!!!!!!!!!!!!!!!!!!!!!!!! ==> Update LastSync tb_quatation error. " + error);
                                        reject(error);
                                    }
                                )
                            }
                            , (error) => {
                                console.log(error);
                                reject(error);
                            }
                        )
                    }
                    catch (error) {
                        console.log(error);
                        reject(error);
                    }
                },
开发者ID:warozz,项目名称:D3VMobiz,代码行数:31,代码来源:quotation-service.ts



注:本文中的@ionic-native/sqlite.SQLite类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript sqlite.SQLiteObject类代码示例发布时间:2022-05-28
下一篇:
TypeScript ngx.SplashScreen类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap