{"id":13743794,"url":"https://github.com/probertson/air-sqlite","last_synced_at":"2025-05-09T01:33:15.925Z","repository":{"id":799464,"uuid":"500200","full_name":"probertson/air-sqlite","owner":"probertson","description":"Utilities for working with SQLite databases in AIR","archived":false,"fork":false,"pushed_at":"2012-02-20T21:39:00.000Z","size":2422,"stargazers_count":76,"open_issues_count":6,"forks_count":17,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-08-03T05:02:38.603Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://probertson.com/projects/air-sqlite/","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"hyperium/hyper","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/probertson.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-02-03T04:34:06.000Z","updated_at":"2024-04-18T12:20:07.000Z","dependencies_parsed_at":"2022-08-16T10:55:19.453Z","dependency_job_id":null,"html_url":"https://github.com/probertson/air-sqlite","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probertson%2Fair-sqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probertson%2Fair-sqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probertson%2Fair-sqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probertson%2Fair-sqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/probertson","download_url":"https://codeload.github.com/probertson/air-sqlite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224802707,"owners_count":17372487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T05:00:57.264Z","updated_at":"2024-11-15T15:30:33.600Z","avatar_url":"https://github.com/probertson.png","language":"ActionScript","readme":"The air-sqlite project is a set of utility classes to make it easier to work with\nSQLite databases using Adobe AIR while following good practices for performance.\n\nReference documentation is available here: [air-sqlite language reference \"asdocs\"](http://probertson.com/resources/projects/air-sqlite/asdoc/)\n\nFor more information about the design philosophy see the project page here: [air-sqlite project page](http://probertson.com/projects/air-sqlite/)\n\nThe primary utility is the SQLRunner class, which provides a way to execute SQL statements.\nThe statements are executed using a pool of database connections so SELECT statements\nare executed at the same time (as long as database connections are available in the \npool).\n\nSELECT example\n--------------\n\nHere is a basic usage example for a SELECT statement, which uses the SQLRunner.execute()\nmethod:\n\n    // setup code:\n    // define database file location\n    var dbFile:File = File.applicationStorageDirectory.resolvePath(\"myDatabase.db\");\n    // create the SQLRunner\n    var sqlRunner:SQLRunner = new SQLRunner(dbFile);\n    \n    // ...\n    \n    // run the statement, passing in one parameter (\":employeeId\" in the SQL)\n    // the statement returns an Employee object as defined in the 4th parameter\n    sqlRunner.execute(LOAD_EMPLOYEE_SQL, {employeeId:102}, resultHandler, Employee);\n    \n    private function resultHandler(result:SQLResult):void\n    {\n    \tvar employee:Employee = result.data[0];\n    \t// do something with the employee data\n    }\n    \n    // constant for actual SQL statement text\n    [Embed(source=\"sql/LoadEmployee.sql\", mimeType=\"application/octet-stream\")]\n    private static const LoadEmployeeStatementText:Class;\n    private static const LOAD_EMPLOYEE_SQL:String = new LoadEmployeeStatementText();\n\nThe SQL statement for this example is as follows:\n\n    SELECT firstName,\n        lastName,\n        email,\n        phone\n    FROM main.employees\n    WHERE employeeId = :employeeId\n\nINSERT/UPDATE/DELETE example\n----------------------------\n\nHere is a basic example for an INSERT/UPDATE/DELETE statement. To execute those statements\nuse the executeModify() method. The executeModify() method accepts a \"batch\" of statements\n(a Vector of QueuedStatement objects). If you pass more than one statement together in a batch,\nthe batch executes as a single transaction.\n\n    var insert:QueuedStatement = new QueuedStatement(INSERT_EMPLOYEE_SQL, {firstName:\"John\", lastName:\"Smith\"});\n    var update:QueuedStatement = new QueuedStatement(UPDATE_EMPLOYEE_SALARY_SQL, {employeeId:100, salary:1000});\n    var statementBatch:Vector.\u003cQueuedStatement\u003e = Vector.\u003cQueuedStatement\u003e([insert, update]);\n    \n    sqlRunner.executeModify(statementBatch, resultHandler, errorHandler, progressHandler);\n    \n    private function resultHandler(results:Vector.\u003cSQLResult\u003e):void\n    {\n    \t// all operations done\n    }\n    \n    private function errorHandler(error:SQLError):void\n    {\n    \t// something went wrong\n    }\n    \n    private function progressHandler(numStepsComplete:uint, totalSteps:uint):void\n    {\n    \tvar progressPercent:int = numStepsComplete / totalSteps;\n    }\n    \n    // constants for actual SQL statement text\n    [Embed(source=\"sql/InsertEmployee.sql\", mimeType=\"application/octet-stream\")]\n    private static const InsertEmployeeStatementText:Class;\n    private static const INSERT_EMPLOYEE_SQL:String = new InsertEmployeeStatementText();\n    \n    [Embed(source=\"sql/UpdateEmployeeSalary.sql\", mimeType=\"application/octet-stream\")]\n    private static const UpdateEmployeeSalaryStatementText:Class;\n    private static const UPDATE_EMPLOYEE_SALARY_SQL:String = new UpdateEmployeeSalaryStatementText();","funding_links":[],"categories":["Networking","Database"],"sub_categories":["Database"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprobertson%2Fair-sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprobertson%2Fair-sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprobertson%2Fair-sqlite/lists"}