Titanium JIRA Archive
Alloy (ALOY)

[ALOY-456] Support multiple databases in sql adapter

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusResolved
ResolutionFixed
Resolution Date2013-01-17T20:07:12.000+0000
Affected Version/sn/a
Fix Version/sAlloy 0.3.5, 2013 Sprint 02
ComponentsRuntime
Labelsalloy, notable
ReporterSimon Giles
AssigneeUnknown
Created2012-12-27T19:11:18.000+0000
Updated2018-03-07T22:25:48.000+0000

Description

update

Alloy will support multiple sqlite databases in an app one of two ways: 1. By adding the *db_name* property to the *definition.adapter* object to identify the name of the database you would like to use/create. See here: [LINK COMING] 2. By loading from an existing database with the *db_file* field (from ALOY-345). Alloy will automatically use the basename of the file as the database. So if your db_file is "myapp.sqlite", then alloy will automatically use "myapp" as the database for all operations. It would be nice to be able to pass a database filename as part of the model.config.adapter when creating a SQL model - instead of defaulting to the _alloy_ database name. This would be helpful for situations where we might want to have multiple databases with differing configurations - for example: one database which is shared over iCloud, and one which is unshared and stored in the cahe directory.

Comments

  1. Tony Lukasavage 2013-01-17

    test app: https://github.com/appcelerator/alloy/tree/master/test/apps/models/sql_queries

JSON Source