Skip to content

Commit

Permalink
Insert Query issue solved , added option for case insensitive search
Browse files Browse the repository at this point in the history
Insert Query issue solved , added option for case insensitive search
  • Loading branch information
ujjwalguptaofficial committed Nov 8, 2017
1 parent c2d2219 commit 3fa065f
Show file tree
Hide file tree
Showing 19 changed files with 6,189 additions and 234 deletions.
2 changes: 1 addition & 1 deletion Code/JsStore/Business/BaseLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ module JsStore {

protected goToWhereLogic = function () {
var Column = getObjectFirstKey(this.Query.Where);
if (!this.Query.Casing) {
if (this.Query.IgnoreCase === true) {
this.Query.Where = this.makeQryInCaseSensitive(this.Query.Where);
}
if (this.ObjectStore.indexNames.contains(Column)) {
Expand Down
1 change: 0 additions & 1 deletion Code/JsStore/Business/Select/InstanceLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ module JsStore {
this.OnError = onError;
this.SkipRecord = this.Query.Skip;
this.LimitRecord = this.Query.Limit;
this.Query.Casing = this.Query.Casing ? this.Query.Casing : true;
try {
this.Transaction = DbConnection.transaction([query.From], "readonly");
this.Transaction.oncomplete = function (e) {
Expand Down
7 changes: 5 additions & 2 deletions Code/JsStore/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module JsStore {
Sum: any,
Avg: any
},
Casing: false
IgnoreCase: boolean
}

export interface IOrder {
Expand All @@ -33,20 +33,23 @@ module JsStore {

export interface ICount {
From: any,
IgnoreCase: boolean,
Where: any,
OnSuccess: Function,
OnError: Function
}

export interface IDelete {
From: string,
IgnoreCase: boolean,
Where: any,
OnSuccess: Function,
OnError: Function
}

export interface IUpdate {
In: string,
IgnoreCase: boolean,
Set: any,
Where: any,
OnSuccess: Function,
Expand Down Expand Up @@ -128,5 +131,5 @@ module JsStore {
Avg: Array<any>
}


}
2 changes: 1 addition & 1 deletion Code/License.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/** JsStore.js - v1.2.4 - 03/11/2017
/** JsStore.js - v1.2.5 - 08/11/2017
* https://github.com/ujjwalguptaofficial/JsStore
* Copyright (c) 2017 @Ujjwal Gupta; Licensed MIT */
1 change: 0 additions & 1 deletion Code/outputfile/JsStore-1.2.4.js.map

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -223,26 +223,29 @@ declare module JsStore {
Sum: any;
Avg: any;
};
Casing: false;
IgnoreCase: boolean;
}
interface IOrder {
By: string;
Type: string;
}
interface ICount {
From: any;
IgnoreCase: boolean;
Where: any;
OnSuccess: Function;
OnError: Function;
}
interface IDelete {
From: string;
IgnoreCase: boolean;
Where: any;
OnSuccess: Function;
OnError: Function;
}
interface IUpdate {
In: string;
IgnoreCase: boolean;
Set: any;
Where: any;
OnSuccess: Function;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Code/outputfile/JsStore-1.2.5.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Code/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"removeComments": false,
"sourceMap": true,
"inlineSources": true,
"out": "outputfile/JsStore-1.2.4.js",
"out": "outputfile/JsStore-1.2.5.js",
"target": "es5",
"preserveConstEnums": true,
"declaration": true
Expand Down
1 change: 0 additions & 1 deletion Dist/Latest/V 1.2.4/JsStore-1.2.4.js.map

This file was deleted.

4 changes: 0 additions & 4 deletions Dist/Latest/V 1.2.4/JsStore-1.2.4.min.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** JsStore.js - v1.2.4 - 03/11/2017
/** JsStore.js - v1.2.5 - 08/11/2017
* https://github.com/ujjwalguptaofficial/JsStore
* Copyright (c) 2017 @Ujjwal Gupta; Licensed MIT */
declare module KeyStore {
Expand Down Expand Up @@ -191,6 +191,16 @@ declare module JsStore {
NotStarted = "not_started",
UnableToStart = "unable_to_start",
}
enum WhereQryOption {
In = "In",
Like = "Like",
Or = "Or",
}
enum DataType {
String = "string",
Object = "object",
Array = "array",
}
}
declare module JsStore {
interface DbInfo {
Expand All @@ -216,25 +226,29 @@ declare module JsStore {
Sum: any;
Avg: any;
};
IgnoreCase: boolean;
}
interface IOrder {
By: string;
Type: string;
}
interface ICount {
From: any;
IgnoreCase: boolean;
Where: any;
OnSuccess: Function;
OnError: Function;
}
interface IDelete {
From: string;
IgnoreCase: boolean;
Where: any;
OnSuccess: Function;
OnError: Function;
}
interface IUpdate {
In: string;
IgnoreCase: boolean;
Set: any;
Where: any;
OnSuccess: Function;
Expand Down Expand Up @@ -423,7 +437,24 @@ declare module JsStore {
}
declare module JsStore {
module Business {
class Base {
class BaseHelper {
protected getTable: (tableName: string) => Table;
protected getKeyRange: (value: any, op: any) => IDBKeyRange;
protected getObjectSecondKey: (value: any) => string;
protected getPrimaryKey: (tableName: any) => any;
private getKeyPath;
protected sortNumberInAsc: (values: any) => any;
protected sortNumberInDesc: (values: any) => any;
protected sortAlphabetInAsc: (values: any) => any;
protected sortAlphabetInDesc: (values: any) => any;
private getCombination(word);
protected getAllCombinationOfWord(word: any, isArray: any): any[];
}
}
}
declare module JsStore {
module Business {
class Base extends BaseHelper {
Error: IError;
ErrorOccured: boolean;
ErrorCount: number;
Expand All @@ -448,16 +479,8 @@ declare module JsStore {
* @memberOf SelectLogic
*/
protected checkForWhereConditionMatch(rowValue: any): boolean;
protected getTable: (tableName: string) => Table;
protected getKeyRange: (value: any, op: any) => IDBKeyRange;
protected getObjectSecondKey: (value: any) => string;
protected goToWhereLogic: () => void;
protected getPrimaryKey: (tableName: any) => any;
private getKeyPath;
protected sortNumberInAsc: (values: any) => any;
protected sortNumberInDesc: (values: any) => any;
protected sortAlphabetInAsc: (values: any) => any;
protected sortAlphabetInDesc: (values: any) => any;
protected makeQryInCaseSensitive: (qry: any) => any;
}
}
}
Expand All @@ -478,25 +501,19 @@ declare module JsStore {
}
declare module JsStore {
module Business {
class Insert extends Base {
class InsertHelper extends Base {
ValuesAffected: any[];
Query: IInsert;
ValuesIndex: number;
Table: Model.ITable;
onTransactionCompleted: () => void;
private checkAndModifyValues;
protected checkModifyInsertValues: (table: any, values: any) => void;
}
}
}
declare module JsStore {
module Business {
class Insert extends InsertHelper {
private insertData;
constructor(query: IInsert, onSuccess: Function, onError: Function);
/**
* check the value based on defined schema and modify or create the value
*
* @private
* @param {any} value
* @param {string} tableName
*
* @memberof InsertLogic
*/
private checkAndModifyValue(value, callBack);
}
}
}
Expand Down
Loading

0 comments on commit 3fa065f

Please sign in to comment.