sqlite - dynamic data in titanium

19
London Titanium - Nov 2011 @ketan #TiLon SQLite & Titanium Who, How & Where Thursday, 1 December 2011

Upload: ket-majmudar

Post on 06-May-2015

4.857 views

Category:

Technology


10 download

DESCRIPTION

Talk delivered to the London Titanium User Group meeting in Nov 2011. An overview of SQLite as a RDBMS and how it can be used to do simple stuff in Appcelerator's Titanium mobile development platform.

TRANSCRIPT

Page 1: SQLite - Dynamic Data in Titanium

London Titanium - Nov 2011 ketanTiLon

SQLite amp Titanium

Who How amp Where

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

About

Ketan Majmudar

ketan (twitter)

spiritquestcouk

stereoartistcom

freakshowukcom

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

SQLite is an embedded SQL database engine Unlike most other SQL databases SQLite

does not have a separate server process SQLite reads and writes

directly to ordinary disk files

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engineThe code for SQLite is in the

public domain and is thus free for use for any purpose

commercial or private SQLite is currently found in more

applications than we can count including several high-profile

projects

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

SQLite is a compact library With all features enabled the library size can be less than

350KiB depending on the target platform and compiler optimization settings

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQL Brief History

Based on RDBMS - Relational Database Management System based around Edgar F Coddrsquos Relational Model

Implements most of the SQL-92 standard

Written by D Richard Hipp in 2000

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TiDatabaseOPEN INSTALL REMOVE

EXECUTE Query

lastInsertRowId

rowsAffected

RESULT Sets

isValidRow

next

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TableDB Creation

CREATE TABLE tbl1 ( id integer NOT NULL PRIMARY KEY AUTOINCREMENT rowValue text)

Create In App Create In GUI PreloadCreate via console

SQLite Database

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(INSERT into tbl1 (rowValue) values(date(now))) alert(Last Insert ID + dblastInsertRowId)

CLOSE DATABASE OBJECTdbclose()

Basic DB usage

httpsgistgithubcom1401196

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TRANSACTION

httpsgistgithubcom1401366

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(BEGIN TRANSACTION) try dbexecute(INSERT into tbl1 (rowValue) values(date(now))) dbexecute(INSERT into tbl1 (rowValues) values() new Date()getDate()) alert(Last Insert ID + dblastInsertRowId) catch(e) alert(emessage) dbexecute(END TRANSACTION)

CLOSE DATABASE OBJECTdbclose()

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

Android SQLite experiment

APK - download link httpsdldropboxcoms8h951ltd80rdyigappapkdl=1

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite VersionsWhat ships on a device look at these tables

SQLite version Device OS

340 iPhone OS 221

3612 iPhone OS 30 31

3622 iPhone OS 40

372 iPhone OS 43

377 iPhone OS 50

SQLite version Device OS

359 Android 15-Cupcake359 Android 16-Donut359 Android 21-Eclair

3622 Android 22-Froyo3622 Android 231-Gingerbread3622 Android 233-Gingerbread374 Android 30-Honeycomb374 Android 31-Honeycomb374 Android 32-Honeycomb 374 Android 40-Ice Cream Sandwich

Supposedly ships with Android

359 21-update1 V93622 22 HTC Desire3622 221 HTC Wildfire3622 221 HTC Magic372 233 Desire HD372 233 LG-P500372 233 Desire HD372 233 Nexus One3622 233 GT-I9100372 233 HTC Wildfire S A510e372 234 HTC Sensation Z710e374 32 G100W374 401 Galaxy Nexus

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 2: SQLite - Dynamic Data in Titanium

London Titanium - Nov 2011 ketanTiLon

About

Ketan Majmudar

ketan (twitter)

spiritquestcouk

stereoartistcom

freakshowukcom

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

SQLite is an embedded SQL database engine Unlike most other SQL databases SQLite

does not have a separate server process SQLite reads and writes

directly to ordinary disk files

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engineThe code for SQLite is in the

public domain and is thus free for use for any purpose

commercial or private SQLite is currently found in more

applications than we can count including several high-profile

projects

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

SQLite is a compact library With all features enabled the library size can be less than

350KiB depending on the target platform and compiler optimization settings

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQL Brief History

Based on RDBMS - Relational Database Management System based around Edgar F Coddrsquos Relational Model

Implements most of the SQL-92 standard

Written by D Richard Hipp in 2000

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TiDatabaseOPEN INSTALL REMOVE

EXECUTE Query

lastInsertRowId

rowsAffected

RESULT Sets

isValidRow

next

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TableDB Creation

CREATE TABLE tbl1 ( id integer NOT NULL PRIMARY KEY AUTOINCREMENT rowValue text)

Create In App Create In GUI PreloadCreate via console

SQLite Database

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(INSERT into tbl1 (rowValue) values(date(now))) alert(Last Insert ID + dblastInsertRowId)

CLOSE DATABASE OBJECTdbclose()

Basic DB usage

httpsgistgithubcom1401196

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TRANSACTION

httpsgistgithubcom1401366

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(BEGIN TRANSACTION) try dbexecute(INSERT into tbl1 (rowValue) values(date(now))) dbexecute(INSERT into tbl1 (rowValues) values() new Date()getDate()) alert(Last Insert ID + dblastInsertRowId) catch(e) alert(emessage) dbexecute(END TRANSACTION)

CLOSE DATABASE OBJECTdbclose()

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

Android SQLite experiment

APK - download link httpsdldropboxcoms8h951ltd80rdyigappapkdl=1

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite VersionsWhat ships on a device look at these tables

SQLite version Device OS

340 iPhone OS 221

3612 iPhone OS 30 31

3622 iPhone OS 40

372 iPhone OS 43

377 iPhone OS 50

SQLite version Device OS

359 Android 15-Cupcake359 Android 16-Donut359 Android 21-Eclair

3622 Android 22-Froyo3622 Android 231-Gingerbread3622 Android 233-Gingerbread374 Android 30-Honeycomb374 Android 31-Honeycomb374 Android 32-Honeycomb 374 Android 40-Ice Cream Sandwich

Supposedly ships with Android

359 21-update1 V93622 22 HTC Desire3622 221 HTC Wildfire3622 221 HTC Magic372 233 Desire HD372 233 LG-P500372 233 Desire HD372 233 Nexus One3622 233 GT-I9100372 233 HTC Wildfire S A510e372 234 HTC Sensation Z710e374 32 G100W374 401 Galaxy Nexus

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 3: SQLite - Dynamic Data in Titanium

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

SQLite is an embedded SQL database engine Unlike most other SQL databases SQLite

does not have a separate server process SQLite reads and writes

directly to ordinary disk files

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engineThe code for SQLite is in the

public domain and is thus free for use for any purpose

commercial or private SQLite is currently found in more

applications than we can count including several high-profile

projects

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

SQLite is a compact library With all features enabled the library size can be less than

350KiB depending on the target platform and compiler optimization settings

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQL Brief History

Based on RDBMS - Relational Database Management System based around Edgar F Coddrsquos Relational Model

Implements most of the SQL-92 standard

Written by D Richard Hipp in 2000

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TiDatabaseOPEN INSTALL REMOVE

EXECUTE Query

lastInsertRowId

rowsAffected

RESULT Sets

isValidRow

next

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TableDB Creation

CREATE TABLE tbl1 ( id integer NOT NULL PRIMARY KEY AUTOINCREMENT rowValue text)

Create In App Create In GUI PreloadCreate via console

SQLite Database

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(INSERT into tbl1 (rowValue) values(date(now))) alert(Last Insert ID + dblastInsertRowId)

CLOSE DATABASE OBJECTdbclose()

Basic DB usage

httpsgistgithubcom1401196

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TRANSACTION

httpsgistgithubcom1401366

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(BEGIN TRANSACTION) try dbexecute(INSERT into tbl1 (rowValue) values(date(now))) dbexecute(INSERT into tbl1 (rowValues) values() new Date()getDate()) alert(Last Insert ID + dblastInsertRowId) catch(e) alert(emessage) dbexecute(END TRANSACTION)

CLOSE DATABASE OBJECTdbclose()

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

Android SQLite experiment

APK - download link httpsdldropboxcoms8h951ltd80rdyigappapkdl=1

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite VersionsWhat ships on a device look at these tables

SQLite version Device OS

340 iPhone OS 221

3612 iPhone OS 30 31

3622 iPhone OS 40

372 iPhone OS 43

377 iPhone OS 50

SQLite version Device OS

359 Android 15-Cupcake359 Android 16-Donut359 Android 21-Eclair

3622 Android 22-Froyo3622 Android 231-Gingerbread3622 Android 233-Gingerbread374 Android 30-Honeycomb374 Android 31-Honeycomb374 Android 32-Honeycomb 374 Android 40-Ice Cream Sandwich

Supposedly ships with Android

359 21-update1 V93622 22 HTC Desire3622 221 HTC Wildfire3622 221 HTC Magic372 233 Desire HD372 233 LG-P500372 233 Desire HD372 233 Nexus One3622 233 GT-I9100372 233 HTC Wildfire S A510e372 234 HTC Sensation Z710e374 32 G100W374 401 Galaxy Nexus

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 4: SQLite - Dynamic Data in Titanium

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

SQLite is an embedded SQL database engine Unlike most other SQL databases SQLite

does not have a separate server process SQLite reads and writes

directly to ordinary disk files

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engineThe code for SQLite is in the

public domain and is thus free for use for any purpose

commercial or private SQLite is currently found in more

applications than we can count including several high-profile

projects

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

SQLite is a compact library With all features enabled the library size can be less than

350KiB depending on the target platform and compiler optimization settings

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQL Brief History

Based on RDBMS - Relational Database Management System based around Edgar F Coddrsquos Relational Model

Implements most of the SQL-92 standard

Written by D Richard Hipp in 2000

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TiDatabaseOPEN INSTALL REMOVE

EXECUTE Query

lastInsertRowId

rowsAffected

RESULT Sets

isValidRow

next

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TableDB Creation

CREATE TABLE tbl1 ( id integer NOT NULL PRIMARY KEY AUTOINCREMENT rowValue text)

Create In App Create In GUI PreloadCreate via console

SQLite Database

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(INSERT into tbl1 (rowValue) values(date(now))) alert(Last Insert ID + dblastInsertRowId)

CLOSE DATABASE OBJECTdbclose()

Basic DB usage

httpsgistgithubcom1401196

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TRANSACTION

httpsgistgithubcom1401366

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(BEGIN TRANSACTION) try dbexecute(INSERT into tbl1 (rowValue) values(date(now))) dbexecute(INSERT into tbl1 (rowValues) values() new Date()getDate()) alert(Last Insert ID + dblastInsertRowId) catch(e) alert(emessage) dbexecute(END TRANSACTION)

CLOSE DATABASE OBJECTdbclose()

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

Android SQLite experiment

APK - download link httpsdldropboxcoms8h951ltd80rdyigappapkdl=1

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite VersionsWhat ships on a device look at these tables

SQLite version Device OS

340 iPhone OS 221

3612 iPhone OS 30 31

3622 iPhone OS 40

372 iPhone OS 43

377 iPhone OS 50

SQLite version Device OS

359 Android 15-Cupcake359 Android 16-Donut359 Android 21-Eclair

3622 Android 22-Froyo3622 Android 231-Gingerbread3622 Android 233-Gingerbread374 Android 30-Honeycomb374 Android 31-Honeycomb374 Android 32-Honeycomb 374 Android 40-Ice Cream Sandwich

Supposedly ships with Android

359 21-update1 V93622 22 HTC Desire3622 221 HTC Wildfire3622 221 HTC Magic372 233 Desire HD372 233 LG-P500372 233 Desire HD372 233 Nexus One3622 233 GT-I9100372 233 HTC Wildfire S A510e372 234 HTC Sensation Z710e374 32 G100W374 401 Galaxy Nexus

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 5: SQLite - Dynamic Data in Titanium

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engineThe code for SQLite is in the

public domain and is thus free for use for any purpose

commercial or private SQLite is currently found in more

applications than we can count including several high-profile

projects

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

SQLite is a compact library With all features enabled the library size can be less than

350KiB depending on the target platform and compiler optimization settings

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQL Brief History

Based on RDBMS - Relational Database Management System based around Edgar F Coddrsquos Relational Model

Implements most of the SQL-92 standard

Written by D Richard Hipp in 2000

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TiDatabaseOPEN INSTALL REMOVE

EXECUTE Query

lastInsertRowId

rowsAffected

RESULT Sets

isValidRow

next

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TableDB Creation

CREATE TABLE tbl1 ( id integer NOT NULL PRIMARY KEY AUTOINCREMENT rowValue text)

Create In App Create In GUI PreloadCreate via console

SQLite Database

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(INSERT into tbl1 (rowValue) values(date(now))) alert(Last Insert ID + dblastInsertRowId)

CLOSE DATABASE OBJECTdbclose()

Basic DB usage

httpsgistgithubcom1401196

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TRANSACTION

httpsgistgithubcom1401366

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(BEGIN TRANSACTION) try dbexecute(INSERT into tbl1 (rowValue) values(date(now))) dbexecute(INSERT into tbl1 (rowValues) values() new Date()getDate()) alert(Last Insert ID + dblastInsertRowId) catch(e) alert(emessage) dbexecute(END TRANSACTION)

CLOSE DATABASE OBJECTdbclose()

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

Android SQLite experiment

APK - download link httpsdldropboxcoms8h951ltd80rdyigappapkdl=1

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite VersionsWhat ships on a device look at these tables

SQLite version Device OS

340 iPhone OS 221

3612 iPhone OS 30 31

3622 iPhone OS 40

372 iPhone OS 43

377 iPhone OS 50

SQLite version Device OS

359 Android 15-Cupcake359 Android 16-Donut359 Android 21-Eclair

3622 Android 22-Froyo3622 Android 231-Gingerbread3622 Android 233-Gingerbread374 Android 30-Honeycomb374 Android 31-Honeycomb374 Android 32-Honeycomb 374 Android 40-Ice Cream Sandwich

Supposedly ships with Android

359 21-update1 V93622 22 HTC Desire3622 221 HTC Wildfire3622 221 HTC Magic372 233 Desire HD372 233 LG-P500372 233 Desire HD372 233 Nexus One3622 233 GT-I9100372 233 HTC Wildfire S A510e372 234 HTC Sensation Z710e374 32 G100W374 401 Galaxy Nexus

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 6: SQLite - Dynamic Data in Titanium

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

SQLite is a compact library With all features enabled the library size can be less than

350KiB depending on the target platform and compiler optimization settings

Thursday 1 December 2011

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQL Brief History

Based on RDBMS - Relational Database Management System based around Edgar F Coddrsquos Relational Model

Implements most of the SQL-92 standard

Written by D Richard Hipp in 2000

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TiDatabaseOPEN INSTALL REMOVE

EXECUTE Query

lastInsertRowId

rowsAffected

RESULT Sets

isValidRow

next

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TableDB Creation

CREATE TABLE tbl1 ( id integer NOT NULL PRIMARY KEY AUTOINCREMENT rowValue text)

Create In App Create In GUI PreloadCreate via console

SQLite Database

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(INSERT into tbl1 (rowValue) values(date(now))) alert(Last Insert ID + dblastInsertRowId)

CLOSE DATABASE OBJECTdbclose()

Basic DB usage

httpsgistgithubcom1401196

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TRANSACTION

httpsgistgithubcom1401366

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(BEGIN TRANSACTION) try dbexecute(INSERT into tbl1 (rowValue) values(date(now))) dbexecute(INSERT into tbl1 (rowValues) values() new Date()getDate()) alert(Last Insert ID + dblastInsertRowId) catch(e) alert(emessage) dbexecute(END TRANSACTION)

CLOSE DATABASE OBJECTdbclose()

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

Android SQLite experiment

APK - download link httpsdldropboxcoms8h951ltd80rdyigappapkdl=1

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite VersionsWhat ships on a device look at these tables

SQLite version Device OS

340 iPhone OS 221

3612 iPhone OS 30 31

3622 iPhone OS 40

372 iPhone OS 43

377 iPhone OS 50

SQLite version Device OS

359 Android 15-Cupcake359 Android 16-Donut359 Android 21-Eclair

3622 Android 22-Froyo3622 Android 231-Gingerbread3622 Android 233-Gingerbread374 Android 30-Honeycomb374 Android 31-Honeycomb374 Android 32-Honeycomb 374 Android 40-Ice Cream Sandwich

Supposedly ships with Android

359 21-update1 V93622 22 HTC Desire3622 221 HTC Wildfire3622 221 HTC Magic372 233 Desire HD372 233 LG-P500372 233 Desire HD372 233 Nexus One3622 233 GT-I9100372 233 HTC Wildfire S A510e372 234 HTC Sensation Z710e374 32 G100W374 401 Galaxy Nexus

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 7: SQLite - Dynamic Data in Titanium

Serverless

Open Source

Compact

London Titanium - Nov 2011 ketanTiLon

What is SQLiteSQLite is a software library that

implements a self-contained serverlesszero-configuration transactional

SQL database engine

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQL Brief History

Based on RDBMS - Relational Database Management System based around Edgar F Coddrsquos Relational Model

Implements most of the SQL-92 standard

Written by D Richard Hipp in 2000

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TiDatabaseOPEN INSTALL REMOVE

EXECUTE Query

lastInsertRowId

rowsAffected

RESULT Sets

isValidRow

next

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TableDB Creation

CREATE TABLE tbl1 ( id integer NOT NULL PRIMARY KEY AUTOINCREMENT rowValue text)

Create In App Create In GUI PreloadCreate via console

SQLite Database

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(INSERT into tbl1 (rowValue) values(date(now))) alert(Last Insert ID + dblastInsertRowId)

CLOSE DATABASE OBJECTdbclose()

Basic DB usage

httpsgistgithubcom1401196

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TRANSACTION

httpsgistgithubcom1401366

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(BEGIN TRANSACTION) try dbexecute(INSERT into tbl1 (rowValue) values(date(now))) dbexecute(INSERT into tbl1 (rowValues) values() new Date()getDate()) alert(Last Insert ID + dblastInsertRowId) catch(e) alert(emessage) dbexecute(END TRANSACTION)

CLOSE DATABASE OBJECTdbclose()

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

Android SQLite experiment

APK - download link httpsdldropboxcoms8h951ltd80rdyigappapkdl=1

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite VersionsWhat ships on a device look at these tables

SQLite version Device OS

340 iPhone OS 221

3612 iPhone OS 30 31

3622 iPhone OS 40

372 iPhone OS 43

377 iPhone OS 50

SQLite version Device OS

359 Android 15-Cupcake359 Android 16-Donut359 Android 21-Eclair

3622 Android 22-Froyo3622 Android 231-Gingerbread3622 Android 233-Gingerbread374 Android 30-Honeycomb374 Android 31-Honeycomb374 Android 32-Honeycomb 374 Android 40-Ice Cream Sandwich

Supposedly ships with Android

359 21-update1 V93622 22 HTC Desire3622 221 HTC Wildfire3622 221 HTC Magic372 233 Desire HD372 233 LG-P500372 233 Desire HD372 233 Nexus One3622 233 GT-I9100372 233 HTC Wildfire S A510e372 234 HTC Sensation Z710e374 32 G100W374 401 Galaxy Nexus

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 8: SQLite - Dynamic Data in Titanium

London Titanium - Nov 2011 ketanTiLon

SQL Brief History

Based on RDBMS - Relational Database Management System based around Edgar F Coddrsquos Relational Model

Implements most of the SQL-92 standard

Written by D Richard Hipp in 2000

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TiDatabaseOPEN INSTALL REMOVE

EXECUTE Query

lastInsertRowId

rowsAffected

RESULT Sets

isValidRow

next

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TableDB Creation

CREATE TABLE tbl1 ( id integer NOT NULL PRIMARY KEY AUTOINCREMENT rowValue text)

Create In App Create In GUI PreloadCreate via console

SQLite Database

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(INSERT into tbl1 (rowValue) values(date(now))) alert(Last Insert ID + dblastInsertRowId)

CLOSE DATABASE OBJECTdbclose()

Basic DB usage

httpsgistgithubcom1401196

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TRANSACTION

httpsgistgithubcom1401366

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(BEGIN TRANSACTION) try dbexecute(INSERT into tbl1 (rowValue) values(date(now))) dbexecute(INSERT into tbl1 (rowValues) values() new Date()getDate()) alert(Last Insert ID + dblastInsertRowId) catch(e) alert(emessage) dbexecute(END TRANSACTION)

CLOSE DATABASE OBJECTdbclose()

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

Android SQLite experiment

APK - download link httpsdldropboxcoms8h951ltd80rdyigappapkdl=1

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite VersionsWhat ships on a device look at these tables

SQLite version Device OS

340 iPhone OS 221

3612 iPhone OS 30 31

3622 iPhone OS 40

372 iPhone OS 43

377 iPhone OS 50

SQLite version Device OS

359 Android 15-Cupcake359 Android 16-Donut359 Android 21-Eclair

3622 Android 22-Froyo3622 Android 231-Gingerbread3622 Android 233-Gingerbread374 Android 30-Honeycomb374 Android 31-Honeycomb374 Android 32-Honeycomb 374 Android 40-Ice Cream Sandwich

Supposedly ships with Android

359 21-update1 V93622 22 HTC Desire3622 221 HTC Wildfire3622 221 HTC Magic372 233 Desire HD372 233 LG-P500372 233 Desire HD372 233 Nexus One3622 233 GT-I9100372 233 HTC Wildfire S A510e372 234 HTC Sensation Z710e374 32 G100W374 401 Galaxy Nexus

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 9: SQLite - Dynamic Data in Titanium

London Titanium - Nov 2011 ketanTiLon

TiDatabaseOPEN INSTALL REMOVE

EXECUTE Query

lastInsertRowId

rowsAffected

RESULT Sets

isValidRow

next

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TableDB Creation

CREATE TABLE tbl1 ( id integer NOT NULL PRIMARY KEY AUTOINCREMENT rowValue text)

Create In App Create In GUI PreloadCreate via console

SQLite Database

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(INSERT into tbl1 (rowValue) values(date(now))) alert(Last Insert ID + dblastInsertRowId)

CLOSE DATABASE OBJECTdbclose()

Basic DB usage

httpsgistgithubcom1401196

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TRANSACTION

httpsgistgithubcom1401366

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(BEGIN TRANSACTION) try dbexecute(INSERT into tbl1 (rowValue) values(date(now))) dbexecute(INSERT into tbl1 (rowValues) values() new Date()getDate()) alert(Last Insert ID + dblastInsertRowId) catch(e) alert(emessage) dbexecute(END TRANSACTION)

CLOSE DATABASE OBJECTdbclose()

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

Android SQLite experiment

APK - download link httpsdldropboxcoms8h951ltd80rdyigappapkdl=1

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite VersionsWhat ships on a device look at these tables

SQLite version Device OS

340 iPhone OS 221

3612 iPhone OS 30 31

3622 iPhone OS 40

372 iPhone OS 43

377 iPhone OS 50

SQLite version Device OS

359 Android 15-Cupcake359 Android 16-Donut359 Android 21-Eclair

3622 Android 22-Froyo3622 Android 231-Gingerbread3622 Android 233-Gingerbread374 Android 30-Honeycomb374 Android 31-Honeycomb374 Android 32-Honeycomb 374 Android 40-Ice Cream Sandwich

Supposedly ships with Android

359 21-update1 V93622 22 HTC Desire3622 221 HTC Wildfire3622 221 HTC Magic372 233 Desire HD372 233 LG-P500372 233 Desire HD372 233 Nexus One3622 233 GT-I9100372 233 HTC Wildfire S A510e372 234 HTC Sensation Z710e374 32 G100W374 401 Galaxy Nexus

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 10: SQLite - Dynamic Data in Titanium

London Titanium - Nov 2011 ketanTiLon

TableDB Creation

CREATE TABLE tbl1 ( id integer NOT NULL PRIMARY KEY AUTOINCREMENT rowValue text)

Create In App Create In GUI PreloadCreate via console

SQLite Database

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(INSERT into tbl1 (rowValue) values(date(now))) alert(Last Insert ID + dblastInsertRowId)

CLOSE DATABASE OBJECTdbclose()

Basic DB usage

httpsgistgithubcom1401196

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TRANSACTION

httpsgistgithubcom1401366

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(BEGIN TRANSACTION) try dbexecute(INSERT into tbl1 (rowValue) values(date(now))) dbexecute(INSERT into tbl1 (rowValues) values() new Date()getDate()) alert(Last Insert ID + dblastInsertRowId) catch(e) alert(emessage) dbexecute(END TRANSACTION)

CLOSE DATABASE OBJECTdbclose()

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

Android SQLite experiment

APK - download link httpsdldropboxcoms8h951ltd80rdyigappapkdl=1

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite VersionsWhat ships on a device look at these tables

SQLite version Device OS

340 iPhone OS 221

3612 iPhone OS 30 31

3622 iPhone OS 40

372 iPhone OS 43

377 iPhone OS 50

SQLite version Device OS

359 Android 15-Cupcake359 Android 16-Donut359 Android 21-Eclair

3622 Android 22-Froyo3622 Android 231-Gingerbread3622 Android 233-Gingerbread374 Android 30-Honeycomb374 Android 31-Honeycomb374 Android 32-Honeycomb 374 Android 40-Ice Cream Sandwich

Supposedly ships with Android

359 21-update1 V93622 22 HTC Desire3622 221 HTC Wildfire3622 221 HTC Magic372 233 Desire HD372 233 LG-P500372 233 Desire HD372 233 Nexus One3622 233 GT-I9100372 233 HTC Wildfire S A510e372 234 HTC Sensation Z710e374 32 G100W374 401 Galaxy Nexus

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 11: SQLite - Dynamic Data in Titanium

London Titanium - Nov 2011 ketanTiLon

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(INSERT into tbl1 (rowValue) values(date(now))) alert(Last Insert ID + dblastInsertRowId)

CLOSE DATABASE OBJECTdbclose()

Basic DB usage

httpsgistgithubcom1401196

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

TRANSACTION

httpsgistgithubcom1401366

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(BEGIN TRANSACTION) try dbexecute(INSERT into tbl1 (rowValue) values(date(now))) dbexecute(INSERT into tbl1 (rowValues) values() new Date()getDate()) alert(Last Insert ID + dblastInsertRowId) catch(e) alert(emessage) dbexecute(END TRANSACTION)

CLOSE DATABASE OBJECTdbclose()

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

Android SQLite experiment

APK - download link httpsdldropboxcoms8h951ltd80rdyigappapkdl=1

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite VersionsWhat ships on a device look at these tables

SQLite version Device OS

340 iPhone OS 221

3612 iPhone OS 30 31

3622 iPhone OS 40

372 iPhone OS 43

377 iPhone OS 50

SQLite version Device OS

359 Android 15-Cupcake359 Android 16-Donut359 Android 21-Eclair

3622 Android 22-Froyo3622 Android 231-Gingerbread3622 Android 233-Gingerbread374 Android 30-Honeycomb374 Android 31-Honeycomb374 Android 32-Honeycomb 374 Android 40-Ice Cream Sandwich

Supposedly ships with Android

359 21-update1 V93622 22 HTC Desire3622 221 HTC Wildfire3622 221 HTC Magic372 233 Desire HD372 233 LG-P500372 233 Desire HD372 233 Nexus One3622 233 GT-I9100372 233 HTC Wildfire S A510e372 234 HTC Sensation Z710e374 32 G100W374 401 Galaxy Nexus

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 12: SQLite - Dynamic Data in Titanium

London Titanium - Nov 2011 ketanTiLon

TRANSACTION

httpsgistgithubcom1401366

OPEN INSTALL DATABASE -- SAFEvar db = TiDatabaseinstall(mydatadynamicdatasqlite dynamicdata) RESULT SET OBJECT var rs = dbexecute(select from tbl1) alert(Rows in table + rsrowCount) while(rsisValidRow()) TiAPIinfo(rsfield(0) + + rsfield(1)) rsnext() rsclose() dbexecute(BEGIN TRANSACTION) try dbexecute(INSERT into tbl1 (rowValue) values(date(now))) dbexecute(INSERT into tbl1 (rowValues) values() new Date()getDate()) alert(Last Insert ID + dblastInsertRowId) catch(e) alert(emessage) dbexecute(END TRANSACTION)

CLOSE DATABASE OBJECTdbclose()

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

Android SQLite experiment

APK - download link httpsdldropboxcoms8h951ltd80rdyigappapkdl=1

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite VersionsWhat ships on a device look at these tables

SQLite version Device OS

340 iPhone OS 221

3612 iPhone OS 30 31

3622 iPhone OS 40

372 iPhone OS 43

377 iPhone OS 50

SQLite version Device OS

359 Android 15-Cupcake359 Android 16-Donut359 Android 21-Eclair

3622 Android 22-Froyo3622 Android 231-Gingerbread3622 Android 233-Gingerbread374 Android 30-Honeycomb374 Android 31-Honeycomb374 Android 32-Honeycomb 374 Android 40-Ice Cream Sandwich

Supposedly ships with Android

359 21-update1 V93622 22 HTC Desire3622 221 HTC Wildfire3622 221 HTC Magic372 233 Desire HD372 233 LG-P500372 233 Desire HD372 233 Nexus One3622 233 GT-I9100372 233 HTC Wildfire S A510e372 234 HTC Sensation Z710e374 32 G100W374 401 Galaxy Nexus

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 13: SQLite - Dynamic Data in Titanium

London Titanium - Nov 2011 ketanTiLon

Android SQLite experiment

APK - download link httpsdldropboxcoms8h951ltd80rdyigappapkdl=1

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite VersionsWhat ships on a device look at these tables

SQLite version Device OS

340 iPhone OS 221

3612 iPhone OS 30 31

3622 iPhone OS 40

372 iPhone OS 43

377 iPhone OS 50

SQLite version Device OS

359 Android 15-Cupcake359 Android 16-Donut359 Android 21-Eclair

3622 Android 22-Froyo3622 Android 231-Gingerbread3622 Android 233-Gingerbread374 Android 30-Honeycomb374 Android 31-Honeycomb374 Android 32-Honeycomb 374 Android 40-Ice Cream Sandwich

Supposedly ships with Android

359 21-update1 V93622 22 HTC Desire3622 221 HTC Wildfire3622 221 HTC Magic372 233 Desire HD372 233 LG-P500372 233 Desire HD372 233 Nexus One3622 233 GT-I9100372 233 HTC Wildfire S A510e372 234 HTC Sensation Z710e374 32 G100W374 401 Galaxy Nexus

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 14: SQLite - Dynamic Data in Titanium

London Titanium - Nov 2011 ketanTiLon

SQLite VersionsWhat ships on a device look at these tables

SQLite version Device OS

340 iPhone OS 221

3612 iPhone OS 30 31

3622 iPhone OS 40

372 iPhone OS 43

377 iPhone OS 50

SQLite version Device OS

359 Android 15-Cupcake359 Android 16-Donut359 Android 21-Eclair

3622 Android 22-Froyo3622 Android 231-Gingerbread3622 Android 233-Gingerbread374 Android 30-Honeycomb374 Android 31-Honeycomb374 Android 32-Honeycomb 374 Android 40-Ice Cream Sandwich

Supposedly ships with Android

359 21-update1 V93622 22 HTC Desire3622 221 HTC Wildfire3622 221 HTC Magic372 233 Desire HD372 233 LG-P500372 233 Desire HD372 233 Nexus One3622 233 GT-I9100372 233 HTC Wildfire S A510e372 234 HTC Sensation Z710e374 32 G100W374 401 Galaxy Nexus

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 15: SQLite - Dynamic Data in Titanium

London Titanium - Nov 2011 ketanTiLon

button1addEventListener(click function() var alertDialog = TiUIcreateAlertDialog( title SQLite version check message You are running SQLite + resultfield(0) + on + TiPlatformname + + TiPlatformversion + + TiPlatformmodel + nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions csvData resultfield(0) + + TiPlatformname + + TiPlatformversion + + TiPlatformmodel++new Date()getTime() buttonNames [No Thanks OK] ) alertDialogshow()

alertDialogaddEventListener(click function(e) if(eindex === 1) var emailKet = TiUIcreateEmailDialog( messageBody Email Text toRecipients [infospiritquestcouk] subject SQLite android data gathering - London Titanium ) emailKetopen() ))var db = TiDatabaseopen(testData1)var result = dbexecute(SELECT sqlite_version())

httpsgistgithubcom1401186

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 16: SQLite - Dynamic Data in Titanium

London Titanium - Nov 2011 ketanTiLon

ORMs

Object Relational Mapping

Apps need to scale

jolijs - Codestrong talk by Xavier Lacot

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 17: SQLite - Dynamic Data in Titanium

London Titanium - Nov 2011 ketanTiLon

SQLite thoughtsextension not required

DB stored in application data directory

BLOBS good for files 10-30Kb based on SQLite version

optimise fields INTEGERS TEXT then BLOB (table create order)

TRANSACTIONS amp ROLLBACKS

BLOBS in SQLite have ROLLBACK protection

Good for cache management

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 18: SQLite - Dynamic Data in Titanium

London Titanium - Nov 2011 ketanTiLon

SQLite EditorsBase

MesaSQLite

RazorSQL

SQLite Database Browser

Firefox Browser extension

Command Line

Thursday 1 December 2011

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011

Page 19: SQLite - Dynamic Data in Titanium

London Titanium - Nov 2011 ketanTiLonThank You

httpwwwsqliteorg

httpwikiappceleratororg

httpdeveloperappceleratorcomapidocmobilelatest

httpwwwsqliteorgchangeshtml

ketan on twitter - wwwstereoartistcomblog

Thursday 1 December 2011