Derek Eder

Civic Tech Builder


« back to blog

12 Jan 2013
Preparing for the Google Fusion Tables SQL API Deprecation

Google Fusion Tables

On January 14, 2013, Google will deprecate the SQL API for their Fusion Tables platform. This post is here to help developers prepare for it (or more likely, fix things after they break).

How to upgrade to the Fusion Tables v1 API

According to Google’s Migration Guide (very useful!), their recommended path is to upgrade your apps to the Fusion Tables v1 API.

I’ve already upgraded the Searchable Map Template, Look at Cook, and forked the fusiontips library (as well as submitted a patch to the original) if you are interested in seeing examples of how it’s done.

Other than changing the endpoint you are querying, there are a few hurdles to upgrading to the v1 API:

  • First, you need to get an API key.
  • Second, the format of the returned data is slightly different, so you will need to change how you process it. This diff gives a good example of that change.

Oops, there are no shortcuts

Earlier, I thought I had a pretty good shortcut around upgrading. I thought that I could just swap out ‘google.com/fusiontables/api/query’ for ‘fusiontables.googleusercontent.com/fusiontables/api/query’ and everything would still work.

Well, after doing some digging and finding this post, I was pretty sure that wouldn’t work.

So, yah, there are some libraries to update now.

fusion_tables gem, I’m here to save you!

The fusion_tables Ruby gem by Simon Tokumine is one of the more awesome things that has been built on top of Fusion Tables. It acts as a lightweight wrapper to create, update and delete your Fusion Tables. Plus, it formats everything as hashes and arrays for easy data manipulation. It’s pretty much the go-to Ruby library for interfacing with Fusion Tables.

Unfortunately, it still uses the old SQL API, so unless it is updated, all applications using it will break after Monday January 14, 2013.

Good news! I submitted a pull request with a patch to have it work with the v1 API. Hopefully it will get merged in soon, but in case it doesn’t and you’re scrambling, you can point to my repo directly.

Update your Gemfile:

gem 'fusion_tables', :git  => 'git://github.com/derekeder/fusion_tables.git'

and run:

bundle update

From there, you can deploy to your server, and you should be good to go.

Note that pointing to a Github repo is not a permenant solution. You should plan on changing it back to the regular gem once it’s updated.

I’ll continue to update this post as things develop. There’s a PHP client library that may need saving as well.


blog comments powered by Disqus

« back to blog

@derekederderek@derekeder.com • © 2017 Derek Eder