SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
SQLite &
                            Titanium
                             Who, How & Where




          #TiLon                                London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
About

                            Ketan Majmudar

                            @ketan (twitter)

                            spiritquest.co.uk

                            stereoartist.com

                            freakshowuk.com




          #TiLon                                        London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
What is SQLite
           SQLite is a software library that
             implements a self-contained,
      serverless,zero-configuration, transactional
                 SQL database engine.



                 Serverless

                 Open Source

                 Compact




          #TiLon                                    London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
What is SQLite
           SQLite is a software library that
             implements a self-contained,             SQLite is an embedded SQL
      serverless,zero-configuration, transactional    database engine. Unlike most
                 SQL database engine.                 other SQL databases, SQLite
                                                    does not have a separate server
                                                    process. SQLite reads and writes
                 Serverless                          directly to ordinary disk files.

                 Open Source

                 Compact




          #TiLon                                                  London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
What is SQLite
           SQLite is a software library that
             implements a self-contained,
      serverless,zero-configuration, transactional
                 SQL database engine.
                                                       The code for SQLite is in the
                                                     public domain and is thus free
                 Serverless                              for use for any purpose,
                                                    commercial or private. SQLite is
                 Open Source                             currently found in more
                                                     applications than we can count
                 Compact                              including several high-profile
                                                                  projects.




          #TiLon                                                  London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
What is SQLite
           SQLite is a software library that
             implements a self-contained,
      serverless,zero-configuration, transactional
                 SQL database engine.



                 Serverless

                 Open Source
                                                      SQLite is a compact library.
                 Compact                             With all features enabled, the
                                                      library size can be less than
                                                    350KiB, depending on the target
                                                         platform and compiler
                                                         optimization settings.



          #TiLon                                                 London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
What is SQLite
           SQLite is a software library that
             implements a self-contained,
      serverless,zero-configuration, transactional
                 SQL database engine.



                 Serverless

                 Open Source

                 Compact




          #TiLon                                    London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
SQL Brief History


                 Based on RDBMS - Relational
                 Database Management System based
                 around Edgar F. Codd’s Relational
                 Model

                 Implements most of the SQL-92
                 standard.

                 Written by D. Richard Hipp in 2000




          #TiLon                                      London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
Ti.Database
            OPEN / INSTALL / REMOVE

                 EXECUTE Query

                       lastInsertRowId

                       rowsAffected

                       RESULT Sets

                            isValidRow

                            next



          #TiLon                                  London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
Table/DB Creation

                                                                       Create In GUI/
         Create In App                   Create via console
                                                                          Preload



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



                                                  SQLite Database




          #TiLon                                                        London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
Basic DB usage
     // OPEN / INSTALL DATABASE -- SAFE
     var db = Ti.Database.install('/mydata/dynamicdata.sqlite', 'dynamicdata');
     	 // RESULT SET OBJECT
     	 var rs = db.execute('select * from tbl1');
     	 alert('Rows in table:' + rs.rowCount);
     	 while(rs.isValidRow()){
     	 	 Ti.API.info(rs.field(0) + ':' + rs.field(1));
     	 	 rs.next();
     	 }
     	 rs.close();
     	
     	 	 db.execute('INSERT into tbl1 (rowValue) values(date("now"))');
     	 	 alert('Last Insert ID:' + db.lastInsertRowId);

     // CLOSE DATABASE OBJECT
     db.close();


                            https://gist.github.com/1401196
          #TiLon                                            London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
TRANSACTION
     // OPEN / INSTALL DATABASE -- SAFE
     var db = Ti.Database.install('/mydata/dynamicdata.sqlite', 'dynamicdata');
     	 // RESULT SET OBJECT
     	 var rs = db.execute('select * from tbl1');
     	 alert('Rows in table:' + rs.rowCount);
     	 while(rs.isValidRow()){
     	 	 Ti.API.info(rs.field(0) + ':' + rs.field(1));
     	 	 rs.next();
     	 }
     	 rs.close();
     	 	 db.execute('BEGIN TRANSACTION');
     	 	 try{
     	 	 db.execute('INSERT into tbl1 (rowValue) values(date("now"))');
     	 	 db.execute('INSERT into tbl1 (rowValues) values(?)', new Date().getDate());
     	 	 alert('Last Insert ID:' + db.lastInsertRowId);
     	 	 } catch(e){
     	 	 	 alert(e.message);
     	 	 }
     	 	 db.execute('END TRANSACTION');

     // CLOSE DATABASE OBJECT
     db.close();

                            https://gist.github.com/1401366
          #TiLon                                                   London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
Android SQLite
                experiment
                      APK - download link:
    https://dl.dropbox.com/s/8h951ltd80rdyig/app.apk?dl=1


          #TiLon                          London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
SQLite Versions
                          What ships on a device: look at these tables.                                Supposedly ships with Android:

                            SQLite version                     Device OS                  SQLite version                   Device OS
                                                                                              3.5.9        Android 1.5-Cupcake
                  3.4.0                         iPhone OS 2.2.1                               3.5.9        Android 1.6-Donut
                                                                                              3.5.9        Android 2.1-Eclair
                  3.6.12                        iPhone OS 3.0 / 3.1                          3.6.22        Android 2.2-Froyo
                                                                                             3.6.22        Android 2.3.1-Gingerbread
                  3.6.22                        iPhone OS 4.0                                3.6.22        Android 2.3.3-Gingerbread
                                                                                              3.7.4        Android 3.0-Honeycomb
                  3.7.2                         iPhone OS 4.3                                 3.7.4        Android 3.1-Honeycomb
                                                                                              3.7.4        Android 3.2-Honeycomb
                  3.7.7                         iPhone OS 5.0                                 3.7.4        Android 4.0-Ice Cream Sandwich



                                                      3.5.9                2.1-update1   V9
                                                      3.6.22               2.2           HTC Desire
                                                      3.6.22               2.2.1         HTC Wildfire
                                                      3.6.22               2.2.1         HTC Magic
                                                      3.7.2                2.3.3         Desire HD
                                                      3.7.2                2.3.3         LG-P500
                                                      3.7.2                2.3.3         Desire HD
                                                      3.7.2                2.3.3         Nexus One
                                                      3.6.22               2.3.3         GT-I9100
                                                      3.7.2                2.3.3         HTC Wildfire S A510e
                                                      3.7.2                2.3.4         HTC Sensation Z710e
                                                      3.7.4                3.2           G100W
                                                      3.7.4                4.0.1         Galaxy Nexus
          #TiLon                                                                                                       London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
button1.addEventListener('click', function(){
   	 var alertDialog = Ti.UI.createAlertDialog({
   	 	 title: 'SQLite version check',
   	 	 message: "You are running SQLite " + result.field(0) + " on: " + Ti.Platform.name
   + ' ' + Ti.Platform.version + ' ' + Ti.Platform.model + 'nnPlease consider emailing
   this to me to build a reference resource of android OS to SQLite versions',
   	 	 csvData: result.field(0) + "," + Ti.Platform.name + ',' + Ti.Platform.version +
   ',' + Ti.Platform.model+','+new Date().getTime(),
   	 	 buttonNames: ['No Thanks', 'OK']
   	 });
   	 alertDialog.show();

   	 alertDialog.addEventListener('click', function(e){
   	 	 if(e.index === 1){
   	 	 	 var emailKet = Ti.UI.createEmailDialog({
   	 	 	 	 messageBody: 'Email Text',
   	 	 	 	 toRecipients: ['info@spiritquest.co.uk'],
   	 	 	 	 subject: 'SQLite android data gathering - London Titanium'
   	 	 	 });
   	 	 	 emailKet.open();
   	 	 }
   	 });
   });
   var db = Ti.Database.open('testData1');
   var result = db.execute("SELECT sqlite_version();");

                            https://gist.github.com/1401186
          #TiLon                                                  London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
ORMs



                            Object Relational Mapping

                            Apps need to scale

                            joli.js - Codestrong talk by Xavier Lacot




          #TiLon                                                        London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
SQLite thoughts
                            extension not required     TRANSACTIONS &
                                                       ROLLBACKS
                            DB stored in application
                            data directory             BLOBS in SQLite have
                                                       ROLLBACK protection.
                            BLOBS good for files
                            10-30Kb based on           Good for cache
                            SQLite version             management.

                            optimise fields:
                            INTEGERS, TEXT then
                            BLOB (table create
                            order)

          #TiLon                                               London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
SQLite Editors
                            Base

                            MesaSQLite

                            RazorSQL

                            SQLite Database
                            Browser

                            Firefox Browser
                            extension

                            Command Line

          #TiLon                              London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011
http://www.sqlite.org

            http://wiki.appcelerator.org

            http://developer.appcelerator.com/apidoc/mobile/latest/

            http://www.sqlite.org/changes.html

            @ketan on twitter - www.stereoartist.com/blog




         Thank You
          #TiLon                                            London Titanium - Nov 2011   @ketan


Thursday, 1 December 2011

Weitere ähnliche Inhalte

Ähnlich wie SQLite - Dynamic Data in Titanium

A brief introduction to SQLite PPT
A brief introduction to SQLite PPTA brief introduction to SQLite PPT
A brief introduction to SQLite PPTJavaTpoint
 
Managing Massive data of the IoT through cooperative semantic nodes
Managing Massive data of the IoT through cooperative semantic nodesManaging Massive data of the IoT through cooperative semantic nodes
Managing Massive data of the IoT through cooperative semantic nodesBenoit Christophe
 
Using object dependencies in sql server 2008 tech republic
Using object dependencies in sql server 2008   tech republicUsing object dependencies in sql server 2008   tech republic
Using object dependencies in sql server 2008 tech republicKaing Menglieng
 
Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09manisoft84
 
Xldb2011 tue 1055_tom_fastner
Xldb2011 tue 1055_tom_fastnerXldb2011 tue 1055_tom_fastner
Xldb2011 tue 1055_tom_fastnerliqiang xu
 
Synchronizing data with ibm tivoli directory integrator 6.1 redp4317
Synchronizing data with ibm tivoli directory integrator 6.1 redp4317Synchronizing data with ibm tivoli directory integrator 6.1 redp4317
Synchronizing data with ibm tivoli directory integrator 6.1 redp4317Banking at Ho Chi Minh city
 
Michael Bayer Introduction to SQLAlchemy @ Postgres Open
Michael Bayer Introduction to SQLAlchemy @ Postgres OpenMichael Bayer Introduction to SQLAlchemy @ Postgres Open
Michael Bayer Introduction to SQLAlchemy @ Postgres OpenPostgresOpen
 
SQL Server Developer 70-433
SQL Server Developer 70-433SQL Server Developer 70-433
SQL Server Developer 70-433jasonyousef
 
Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2asim78
 
Digital Preservation Cloud Services for Libraries and Archives
Digital Preservation Cloud Services for Libraries and ArchivesDigital Preservation Cloud Services for Libraries and Archives
Digital Preservation Cloud Services for Libraries and ArchivesQuyen L. Nguyen
 
Ibm lotus domino integration using ibm tivoli directory integrator redp4629
Ibm lotus domino integration using ibm tivoli directory integrator redp4629Ibm lotus domino integration using ibm tivoli directory integrator redp4629
Ibm lotus domino integration using ibm tivoli directory integrator redp4629Banking at Ho Chi Minh city
 
Inb343 week2 sql server intro
Inb343 week2 sql server introInb343 week2 sql server intro
Inb343 week2 sql server introFredlive503
 
Big Bad PostgreSQL: BI on a Budget
Big Bad PostgreSQL: BI on a BudgetBig Bad PostgreSQL: BI on a Budget
Big Bad PostgreSQL: BI on a BudgetJoshua L. Davis
 
Sql server difference faqs- 6
Sql server difference faqs- 6Sql server difference faqs- 6
Sql server difference faqs- 6Umar Ali
 

Ähnlich wie SQLite - Dynamic Data in Titanium (20)

A brief introduction to SQLite PPT
A brief introduction to SQLite PPTA brief introduction to SQLite PPT
A brief introduction to SQLite PPT
 
Sqlite
SqliteSqlite
Sqlite
 
Sql lite presentation
Sql lite presentationSql lite presentation
Sql lite presentation
 
Managing Massive data of the IoT through cooperative semantic nodes
Managing Massive data of the IoT through cooperative semantic nodesManaging Massive data of the IoT through cooperative semantic nodes
Managing Massive data of the IoT through cooperative semantic nodes
 
Sq lite
Sq liteSq lite
Sq lite
 
Os Owens
Os OwensOs Owens
Os Owens
 
Using object dependencies in sql server 2008 tech republic
Using object dependencies in sql server 2008   tech republicUsing object dependencies in sql server 2008   tech republic
Using object dependencies in sql server 2008 tech republic
 
Getting started with entity framework
Getting started with entity framework Getting started with entity framework
Getting started with entity framework
 
Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09
 
Xldb2011 tue 1055_tom_fastner
Xldb2011 tue 1055_tom_fastnerXldb2011 tue 1055_tom_fastner
Xldb2011 tue 1055_tom_fastner
 
Synchronizing data with ibm tivoli directory integrator 6.1 redp4317
Synchronizing data with ibm tivoli directory integrator 6.1 redp4317Synchronizing data with ibm tivoli directory integrator 6.1 redp4317
Synchronizing data with ibm tivoli directory integrator 6.1 redp4317
 
Michael Bayer Introduction to SQLAlchemy @ Postgres Open
Michael Bayer Introduction to SQLAlchemy @ Postgres OpenMichael Bayer Introduction to SQLAlchemy @ Postgres Open
Michael Bayer Introduction to SQLAlchemy @ Postgres Open
 
SQL Server Developer 70-433
SQL Server Developer 70-433SQL Server Developer 70-433
SQL Server Developer 70-433
 
Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2
 
Digital Preservation Cloud Services for Libraries and Archives
Digital Preservation Cloud Services for Libraries and ArchivesDigital Preservation Cloud Services for Libraries and Archives
Digital Preservation Cloud Services for Libraries and Archives
 
Ibm lotus domino integration using ibm tivoli directory integrator redp4629
Ibm lotus domino integration using ibm tivoli directory integrator redp4629Ibm lotus domino integration using ibm tivoli directory integrator redp4629
Ibm lotus domino integration using ibm tivoli directory integrator redp4629
 
Sq lite
Sq liteSq lite
Sq lite
 
Inb343 week2 sql server intro
Inb343 week2 sql server introInb343 week2 sql server intro
Inb343 week2 sql server intro
 
Big Bad PostgreSQL: BI on a Budget
Big Bad PostgreSQL: BI on a BudgetBig Bad PostgreSQL: BI on a Budget
Big Bad PostgreSQL: BI on a Budget
 
Sql server difference faqs- 6
Sql server difference faqs- 6Sql server difference faqs- 6
Sql server difference faqs- 6
 

Mehr von Ket Majmudar

Ti.connect Awesome UX/UI Strategy with T-10
Ti.connect  Awesome UX/UI Strategy with T-10 Ti.connect  Awesome UX/UI Strategy with T-10
Ti.connect Awesome UX/UI Strategy with T-10 Ket Majmudar
 
JSONH & Mobile APIs
JSONH & Mobile APIsJSONH & Mobile APIs
JSONH & Mobile APIsKet Majmudar
 
T-10 Session at Over The Air 2013
T-10 Session at Over The Air 2013T-10 Session at Over The Air 2013
T-10 Session at Over The Air 2013Ket Majmudar
 
Titanium London - URLs & Alloy vs CommonJS
Titanium London - URLs & Alloy vs CommonJSTitanium London - URLs & Alloy vs CommonJS
Titanium London - URLs & Alloy vs CommonJSKet Majmudar
 
T-10 International Space Apps Challenge Presentation in London 2013
T-10 International Space Apps Challenge Presentation in London 2013T-10 International Space Apps Challenge Presentation in London 2013
T-10 International Space Apps Challenge Presentation in London 2013Ket Majmudar
 
London Titanium July 2012 Intro
London Titanium July 2012 IntroLondon Titanium July 2012 Intro
London Titanium July 2012 IntroKet Majmudar
 
London Titanium July 2012 Intro
London Titanium July 2012 IntroLondon Titanium July 2012 Intro
London Titanium July 2012 IntroKet Majmudar
 
Kitchen Sink to App
Kitchen Sink to AppKitchen Sink to App
Kitchen Sink to AppKet Majmudar
 
Getting Started with Titanium Studio
Getting Started with Titanium StudioGetting Started with Titanium Studio
Getting Started with Titanium StudioKet Majmudar
 
Titanium London - Going Social - June 2011
Titanium London - Going Social - June 2011Titanium London - Going Social - June 2011
Titanium London - Going Social - June 2011Ket Majmudar
 
How to build your own 3D Digital Camera rig
How to build your own 3D Digital Camera rig How to build your own 3D Digital Camera rig
How to build your own 3D Digital Camera rig Ket Majmudar
 

Mehr von Ket Majmudar (12)

Ti.connect Awesome UX/UI Strategy with T-10
Ti.connect  Awesome UX/UI Strategy with T-10 Ti.connect  Awesome UX/UI Strategy with T-10
Ti.connect Awesome UX/UI Strategy with T-10
 
JSONH & Mobile APIs
JSONH & Mobile APIsJSONH & Mobile APIs
JSONH & Mobile APIs
 
T-10 Session at Over The Air 2013
T-10 Session at Over The Air 2013T-10 Session at Over The Air 2013
T-10 Session at Over The Air 2013
 
Titanium London - URLs & Alloy vs CommonJS
Titanium London - URLs & Alloy vs CommonJSTitanium London - URLs & Alloy vs CommonJS
Titanium London - URLs & Alloy vs CommonJS
 
T-10 International Space Apps Challenge Presentation in London 2013
T-10 International Space Apps Challenge Presentation in London 2013T-10 International Space Apps Challenge Presentation in London 2013
T-10 International Space Apps Challenge Presentation in London 2013
 
London Titanium July 2012 Intro
London Titanium July 2012 IntroLondon Titanium July 2012 Intro
London Titanium July 2012 Intro
 
London Titanium July 2012 Intro
London Titanium July 2012 IntroLondon Titanium July 2012 Intro
London Titanium July 2012 Intro
 
Titanium setup
Titanium setupTitanium setup
Titanium setup
 
Kitchen Sink to App
Kitchen Sink to AppKitchen Sink to App
Kitchen Sink to App
 
Getting Started with Titanium Studio
Getting Started with Titanium StudioGetting Started with Titanium Studio
Getting Started with Titanium Studio
 
Titanium London - Going Social - June 2011
Titanium London - Going Social - June 2011Titanium London - Going Social - June 2011
Titanium London - Going Social - June 2011
 
How to build your own 3D Digital Camera rig
How to build your own 3D Digital Camera rig How to build your own 3D Digital Camera rig
How to build your own 3D Digital Camera rig
 

Kürzlich hochgeladen

The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfUK Journal
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptxBT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptxNeo4j
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 

Kürzlich hochgeladen (20)

The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptxBT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 

SQLite - Dynamic Data in Titanium

  • 1. SQLite & Titanium Who, How & Where #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 2. About Ketan Majmudar @ketan (twitter) spiritquest.co.uk stereoartist.com freakshowuk.com #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 3. What is SQLite SQLite is a software library that implements a self-contained, serverless,zero-configuration, transactional SQL database engine. Serverless Open Source Compact #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 4. What is SQLite SQLite is a software library that implements a self-contained, SQLite is an embedded SQL serverless,zero-configuration, transactional database engine. Unlike most SQL database engine. other SQL databases, SQLite does not have a separate server process. SQLite reads and writes Serverless directly to ordinary disk files. Open Source Compact #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 5. What is SQLite SQLite is a software library that implements a self-contained, serverless,zero-configuration, transactional SQL database engine. The code for SQLite is in the public domain and is thus free Serverless for use for any purpose, commercial or private. SQLite is Open Source currently found in more applications than we can count Compact including several high-profile projects. #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 6. What is SQLite SQLite is a software library that implements a self-contained, serverless,zero-configuration, transactional SQL database engine. Serverless Open Source SQLite is a compact library. Compact With all features enabled, the library size can be less than 350KiB, depending on the target platform and compiler optimization settings. #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 7. What is SQLite SQLite is a software library that implements a self-contained, serverless,zero-configuration, transactional SQL database engine. Serverless Open Source Compact #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 8. SQL Brief History Based on RDBMS - Relational Database Management System based around Edgar F. Codd’s Relational Model Implements most of the SQL-92 standard. Written by D. Richard Hipp in 2000 #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 9. Ti.Database OPEN / INSTALL / REMOVE EXECUTE Query lastInsertRowId rowsAffected RESULT Sets isValidRow next #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 10. Table/DB Creation Create In GUI/ Create In App Create via console Preload CREATE TABLE "tbl1" ( "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "rowValue" text ) SQLite Database #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 11. Basic DB usage // OPEN / INSTALL DATABASE -- SAFE var db = Ti.Database.install('/mydata/dynamicdata.sqlite', 'dynamicdata'); // RESULT SET OBJECT var rs = db.execute('select * from tbl1'); alert('Rows in table:' + rs.rowCount); while(rs.isValidRow()){ Ti.API.info(rs.field(0) + ':' + rs.field(1)); rs.next(); } rs.close(); db.execute('INSERT into tbl1 (rowValue) values(date("now"))'); alert('Last Insert ID:' + db.lastInsertRowId); // CLOSE DATABASE OBJECT db.close(); https://gist.github.com/1401196 #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 12. TRANSACTION // OPEN / INSTALL DATABASE -- SAFE var db = Ti.Database.install('/mydata/dynamicdata.sqlite', 'dynamicdata'); // RESULT SET OBJECT var rs = db.execute('select * from tbl1'); alert('Rows in table:' + rs.rowCount); while(rs.isValidRow()){ Ti.API.info(rs.field(0) + ':' + rs.field(1)); rs.next(); } rs.close(); db.execute('BEGIN TRANSACTION'); try{ db.execute('INSERT into tbl1 (rowValue) values(date("now"))'); db.execute('INSERT into tbl1 (rowValues) values(?)', new Date().getDate()); alert('Last Insert ID:' + db.lastInsertRowId); } catch(e){ alert(e.message); } db.execute('END TRANSACTION'); // CLOSE DATABASE OBJECT db.close(); https://gist.github.com/1401366 #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 13. Android SQLite experiment APK - download link: https://dl.dropbox.com/s/8h951ltd80rdyig/app.apk?dl=1 #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 14. SQLite Versions What ships on a device: look at these tables. Supposedly ships with Android: SQLite version Device OS SQLite version Device OS 3.5.9 Android 1.5-Cupcake 3.4.0 iPhone OS 2.2.1 3.5.9 Android 1.6-Donut 3.5.9 Android 2.1-Eclair 3.6.12 iPhone OS 3.0 / 3.1 3.6.22 Android 2.2-Froyo 3.6.22 Android 2.3.1-Gingerbread 3.6.22 iPhone OS 4.0 3.6.22 Android 2.3.3-Gingerbread 3.7.4 Android 3.0-Honeycomb 3.7.2 iPhone OS 4.3 3.7.4 Android 3.1-Honeycomb 3.7.4 Android 3.2-Honeycomb 3.7.7 iPhone OS 5.0 3.7.4 Android 4.0-Ice Cream Sandwich 3.5.9 2.1-update1 V9 3.6.22 2.2 HTC Desire 3.6.22 2.2.1 HTC Wildfire 3.6.22 2.2.1 HTC Magic 3.7.2 2.3.3 Desire HD 3.7.2 2.3.3 LG-P500 3.7.2 2.3.3 Desire HD 3.7.2 2.3.3 Nexus One 3.6.22 2.3.3 GT-I9100 3.7.2 2.3.3 HTC Wildfire S A510e 3.7.2 2.3.4 HTC Sensation Z710e 3.7.4 3.2 G100W 3.7.4 4.0.1 Galaxy Nexus #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 15. button1.addEventListener('click', function(){ var alertDialog = Ti.UI.createAlertDialog({ title: 'SQLite version check', message: "You are running SQLite " + result.field(0) + " on: " + Ti.Platform.name + ' ' + Ti.Platform.version + ' ' + Ti.Platform.model + 'nnPlease consider emailing this to me to build a reference resource of android OS to SQLite versions', csvData: result.field(0) + "," + Ti.Platform.name + ',' + Ti.Platform.version + ',' + Ti.Platform.model+','+new Date().getTime(), buttonNames: ['No Thanks', 'OK'] }); alertDialog.show(); alertDialog.addEventListener('click', function(e){ if(e.index === 1){ var emailKet = Ti.UI.createEmailDialog({ messageBody: 'Email Text', toRecipients: ['info@spiritquest.co.uk'], subject: 'SQLite android data gathering - London Titanium' }); emailKet.open(); } }); }); var db = Ti.Database.open('testData1'); var result = db.execute("SELECT sqlite_version();"); https://gist.github.com/1401186 #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 16. ORMs Object Relational Mapping Apps need to scale joli.js - Codestrong talk by Xavier Lacot #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 17. SQLite thoughts extension not required TRANSACTIONS & ROLLBACKS DB stored in application data directory BLOBS in SQLite have ROLLBACK protection. BLOBS good for files 10-30Kb based on Good for cache SQLite version management. optimise fields: INTEGERS, TEXT then BLOB (table create order) #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 18. SQLite Editors Base MesaSQLite RazorSQL SQLite Database Browser Firefox Browser extension Command Line #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011
  • 19. http://www.sqlite.org http://wiki.appcelerator.org http://developer.appcelerator.com/apidoc/mobile/latest/ http://www.sqlite.org/changes.html @ketan on twitter - www.stereoartist.com/blog Thank You #TiLon London Titanium - Nov 2011 @ketan Thursday, 1 December 2011