Migrating From Sql Api To Fusion Tables V1
After SQL API was deprecated searching solution to migrate from SQL API https://www.google.com/fusiontables/api/query?sql= to https://www.googleapis.com/fusiontables/v1/query?sql=
Solution 1:
Finaly! Found pure and simple solution by replacing jQuery examp. with google-api-javascript-client
Don't forget to add into head tag<script src="https://apis.google.com/js/client.js?onload=load"></script>
myTable1 = newFT('table1_id')
myTable1.run('SELECT * FROM ', myTable1, ' ORDER BY id ASC ')
functionFT(table_id)
{
this.counter = 0this.table = table_id
//
gapi.client.setApiKey('Api_Key')
//this.run = function (q, cls, order)
{
gapi.client.load('fusiontables', 'v1', function(){
var request = gapi.client.fusiontables.query.sqlGet({'sql': q + cls.table + order});
request.execute(function(DATA){cls.exec(DATA)});
});
}
//this.exec = function (DATA)
{
alert(DATA.result.rows.length)
}
}
EDIT:
Or simply just like in first example above change this
var URLTable = encodeURI('SELECT id,COUNT() FROM TABLE_ID')
to this
var URLTable = encodeURI('SELECT COUNT() FROM TABLE_ID')
Post a Comment for "Migrating From Sql Api To Fusion Tables V1"