Tuesday, 15 April 2014

ios - How do you switch from SQL to Table Storage in Azure Mobile Services? -



ios - How do you switch from SQL to Table Storage in Azure Mobile Services? -

i've signed free month trial of azure, , have created mobile service. i'm using ios, downloaded model todo app ios.

i trying utilize table storage in end instead of mssql store; have found instructions on using table storage here: http://azure.microsoft.com/en-us/documentation/articles/storage-nodejs-how-to-use-table-storage/

however, app still storing todo items in mssql storage. i've been told don't need in client create switch, assume need must done in node.js scripts. i'm missing something.

one thing confuses me after downloaded generated node.js script todo app, didn't see in seemed explicitly talking mssql database.

any pointers appreciated.

edit: here's todoitem.insert.js:

var azure = require('azure-storage'); var tablesvc = azure.createtableservice(); function insert(item, user, request) { // request.execute(); console.log('request received'); console.log(request); var entgen = azure.tableutilities.entitygenerator; var task = { partitionkey: entgen.string('learningazure'), rowkey: entgen.string('1'), description: entgen.string('add ts'), duedate: entgen.datetime(new date(date.utc(2014, 11, 5))), }; tablesvc.insertentity('codedelphi',task, {echocontent: true}, function (error, result, response) { if(!error){ // entity inserted console.log('no error on table insert: task created.'); request.respond(statuscodes.success, 'ok.'); } else { console.log('houston, have problem. entity not added table.'); console.log(error); } }); console.log(json.stringify(item, null, 4)); } tablesvc.createtableifnotexists('codedelphi', function(error, result, response){ if(!error){ // table exists or created console.log('no error, table should exist'); } else { console.log('we have problem.'); console.log(error); } });

as chris pointed out, still calling request.execute() table scripts. design, explicitly talk mssql database configured application with. have edit table scripts not perform "request.execute()" , instead interact tableservice object.

if follow tutorial, , following: 1. import package. 2. create table service object. 3. create entity (and modify variables store info need) 4. write entity table service.

you should see info beingness written table storage rather sql database.

give shot , ping back, we'll help out.

ios sql-server node.js azure

No comments:

Post a Comment