Skip to content

Instantly share code, notes, and snippets.

@JTCunning
Last active August 27, 2015 23:27
Show Gist options
  • Save JTCunning/7faac525cf4367b7bf50 to your computer and use it in GitHub Desktop.
Save JTCunning/7faac525cf4367b7bf50 to your computer and use it in GitHub Desktop.

Problem

Creating a seperate python client for clusto-apiserver would have multiple codebases that required updating, namely schema and drivers.

Solution

We add support for http(s) DSNs that will query an apiserver instance instead of using sqlalchemy.

Process

These will probably all be PRs so that this will be more managable.

  • Modify usage of SESSION to only be functional when SESSION is instantiated.
  • Implement the ability to recognize http DSNs and raise NotImplementedError for any method that requires queries.
  • Move object serialization methods from clusto-apiserver to core.
  • Implement core get methods.
  • Implement all other methods.

Random Notes

At first I thought it would be a good idea to try and have all of these methods reference a utility that would decide between querying the api or the db, but there were few enough methods and unique enough queries that it simply would not save any reproduced code.

@plathrop
Copy link

This sounds reasonable to me. 👍

@JeremyGrosser
Copy link

Seems like a reasonable change. I think there might be more than one place where the CLUSTODSN env variable is used, so just make sure they're all calling to clusto.connect() at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment