diff --git a/dist/Model.js b/dist/Model.js index c47d365..5a70922 100644 --- a/dist/Model.js +++ b/dist/Model.js @@ -215,7 +215,7 @@ class Model { case 'string': return String(value); case 'date': - return !!value ? new Date(value) : null; + return !!value ? new Date(new Date(value).toISOString().replace('Z', '')) : null; case 'datetime': return !!value ? new Date(value) : null; case 'json': diff --git a/dist/Model.js.map b/dist/Model.js.map index c6d4c9b..7c1a963 100644 --- a/dist/Model.js.map +++ b/dist/Model.js.map @@ -1 +1 @@ -{"version":3,"file":"Model.js","sourceRoot":"","sources":["../src/Model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAqC;AA8BrC,MAAa,KAAK;IAoBhB,YAAa,aAA8B,EAAE;QAC3C,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;QAC/B,IAAI,CAAC,SAAS,GAAG;YACf,OAAO,EAAE;gBACP,MAAM,EAAE,GAAG;gBACX,KAAK,EAAE,EAAE;gBACT,KAAK,EAAE,EAAE;gBACT,OAAO,EAAE,EAAE;gBACX,KAAK,EAAE,IAAI;gBACX,aAAa,EAAE,EAAE;aAClB;SACF,CAAA;QAED,OAAO,IAAI,KAAK,CAAQ,IAAI,EAAE;YAC5B,GAAG,EAAE,CAAC,MAAa,EAAE,IAAqB,EAAE,QAAa,EAAE,EAAE;;gBAC3D,6EAA6E;gBAC7E,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;oBAC5B,IACE,OAAO,MAAM,CAAC,IAAmB,CAAC,KAAK,UAAU;wBACjD,CAAC,CAAC,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;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a,GAAG,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACvE;YAED,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;YAE5C,yCAAyC;YACzC,IAAI,CAAC,UAAU,EAAE;gBACf,UAAU,GAAG,GAAG,WAAW,IAAI,CAAC,CAAC,yDAAyD;aAC3F;YACD,IAAI,CAAC,QAAQ,EAAE;gBACb,QAAQ,GAAG,GAAG,WAAW,IAAI,CAAC,CAAC,yDAAyD;aACzF;YAED,+CAA+C;YAC/C,MAAM,SAAS,GAAG,MAAM,kBAAkB;iBACvC,MAAM,CAAC,GAAG,gBAAgB,IAAI,CAAC;iBAC/B,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,aAAa,IAAI,QAAQ,EAAE,EAAE,GAAG,gBAAgB,KAAK,CAAC;iBACtF,KAAK,CAAC,GAAG,aAAa,IAAI,UAAU,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC;iBACrD,GAAG,EAAE,CAAC;YAET,iDAAiD;YACjD,OAAO,SAAS,CAAC;QACnB,CAAC;KAAA;;AApiBH,sBAqiBC;AApiBgB,QAAE,GAAG,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAA;AAE1C,eAAS,GAAG,EAAE,CAAA;AAEd,WAAK,GAAU;IACpB,SAAS,EAAE,UAAU;IACrB,SAAS,EAAE,UAAU;CACtB,CAAA;AAEM,oBAAc,GAAY,IAAI,CAAC;AAC/B,qBAAe,GAAW,WAAW,CAAC;AACtC,qBAAe,GAAW,WAAW,CAAC"} \ No newline at end of file diff --git a/example/App.js b/example/App.js index 3338a43..5ef7a53 100644 --- a/example/App.js +++ b/example/App.js @@ -4,6 +4,13 @@ import { Button, StyleSheet, Text, View } from 'react-native'; import { Model, Migration } from './local-version-of-expo-sqlite-eloquent-orm'; // Define some models +class Event extends Model { + static casts = { + startDate: 'date', + endDate: 'date', + }; +} + class Group extends Model { static withTimestamps = false; @@ -37,6 +44,17 @@ class Person extends Model { // Define migrations const migrations = { + '1699142746_init_events': ` + CREATE TABLE IF NOT EXISTS events ( + id INTEGER PRIMARY KEY NOT NULL, + createdAt DATETIME NOT NULL, + updatedAt DATETIME NOT NULL, + name TEXT, + startDate DATE, + endDate DATE, + notes TEXT + ); + `, '1699142747_init_groups': ` CREATE TABLE IF NOT EXISTS groups ( id INTEGER PRIMARY KEY NOT NULL, @@ -72,6 +90,11 @@ const migrations = { // Seed data const seedData = { + events: [ + { id: 1, name: 'Birthday Party', startDate: '2024-10-01', notes: 'Bring a gift!' }, + { id: 2, name: 'Wedding', startDate: '2025-01-01', endDate: '2025-01-01' }, + { id: 3, name: 'Graduation', startDate: '2025-05-01', endDate: '2025-05-04' }, + ], groups: [ { id: 1, name: 'Family' }, { id: 2, name: 'Friends' }, @@ -99,7 +122,7 @@ const seedData = { export default function App() { - // const [groups, setGroups] = useState([]); + const [events, setEvents] = useState([]); const [location, setLocation] = useState(null); const [locations, setLocations] = useState([]); const [people, setPeople] = useState([]); @@ -120,6 +143,9 @@ export default function App() { // Run whenever we trigger rerender so we can see what deleting and recreating the database does useEffect(() => { (async() => { + const events = await Event.get(); + setEvents(events); + const location = await Location.with('people').find(1); setLocation(location); @@ -144,6 +170,7 @@ export default function App() { } const seedDatabase = async () => { + await Event.seed(seedData.events); await Group.seed(seedData.groups); await Location.seed(seedData.locations); await Person.seed(seedData.people); @@ -156,6 +183,13 @@ export default function App() { return ( + Events: + {!!events.length && events.map(event => ( + {event.name} - {Intl.DateTimeFormat(undefined).format(event.startDate)} {!!event.endDate ? `to ${Intl.DateTimeFormat(undefined).format(event.endDate)}` : ''} + ))} + + + Location: {!!location && ( {location.name} - {!!location?.people?.length && location.people.map(person => person.name).join(', ')} diff --git a/example/local-version-of-expo-sqlite-eloquent-orm/Model.ts b/example/local-version-of-expo-sqlite-eloquent-orm/Model.ts index bc9715c..603daa2 100644 --- a/example/local-version-of-expo-sqlite-eloquent-orm/Model.ts +++ b/example/local-version-of-expo-sqlite-eloquent-orm/Model.ts @@ -1,6 +1,6 @@ import * as SQLite from 'expo-sqlite' -type Casts = {[key: string]: 'number' | 'boolean' | 'string' | 'date' | 'json'} +type Casts = {[key: string]: 'number' | 'boolean' | 'string' | 'date' | 'datetime' | 'json'} type Clauses = { select: string @@ -11,7 +11,7 @@ type Clauses = { secondKey: string }> where: Array<{ column: string, operator: string, value?: any }> - orderBy: { column: string, direction: string } | null + orderBy: Array<{ column: string, direction: string }> limit: number | null withRelations: string[] } @@ -34,8 +34,8 @@ export class Model { static tableName = '' static casts: Casts = { - createdAt: 'date', - updatedAt: 'date', + createdAt: 'datetime', + updatedAt: 'datetime', } static withTimestamps: boolean = true; @@ -55,7 +55,7 @@ export class Model { select: '*', joins: [], where: [], - orderBy: null, + orderBy: [], limit: null, withRelations: [] } @@ -85,6 +85,7 @@ export class Model { static async resetDatabase() { await this.db.closeAsync(); await this.db.deleteAsync(); + // @ts-ignore this.db = null; this.db = SQLite.openDatabase('app.db'); } @@ -216,6 +217,8 @@ export class Model { case 'string': return String(value); case 'date': + return !!value ? new Date((new Date(value).toISOString()).replace('Z', '')) : null; + case 'datetime': return !!value ? new Date(value) : null; case 'json': try { @@ -240,7 +243,9 @@ export class Model { case 'string': return String(value); case 'date': - return value instanceof Date ? value.toISOString() : value; + return value instanceof Date ? value.toISOString().split('T')[0] : (new Date(value)).toISOString().split('T')[0]; + case 'datetime': + return value instanceof Date ? value.toISOString() : (new Date(value)).toISOString(); case 'json': try { return JSON.stringify(value); @@ -278,7 +283,7 @@ export class Model { } orderBy (column: string, direction: 'ASC' | 'DESC' = 'ASC'): this { - this.__private.clauses.orderBy = { column, direction } + this.__private.clauses.orderBy.push({ column, direction }) return this } @@ -400,8 +405,12 @@ export class Model { } // Add ORDER BY clause if set - if (this.__private.clauses.orderBy) { - query += ` ORDER BY ${this.clauses.orderBy.column} ${this.clauses.orderBy.direction}` + if (this.__private.clauses.orderBy.length > 0) { + const orderByClauses = this.__private.clauses.orderBy.map(clause => { + return `${clause.column} ${clause.direction}` + }).join(', ') + + query += ` ORDER BY ${orderByClauses}` } // Add LIMIT clause if set diff --git a/package.json b/package.json index ed8bff1..d1073eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "expo-sqlite-eloquent-orm", - "version": "0.9.19", + "version": "0.9.20", "description": "An Expo SQLite ORM", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/Model.ts b/src/Model.ts index 61a7707..603daa2 100644 --- a/src/Model.ts +++ b/src/Model.ts @@ -217,7 +217,7 @@ export class Model { case 'string': return String(value); case 'date': - return !!value ? new Date(value) : null; + return !!value ? new Date((new Date(value).toISOString()).replace('Z', '')) : null; case 'datetime': return !!value ? new Date(value) : null; case 'json':