Shotgun API vs Direct Database Access


I was wondering just how dangerous it is to deal with the shotgun database directly, or perhaps via a Python OPM like Peewee or SqlAlchemy, rather than going through the API. Put differently, is there a lot of high level logic in the api, with hidden but important cascading behaviors? Or is the API essentially just exposing the basic data objects that we might alternatively use a different method to do?

I'd really like to create a suite of Python Peewee OPM classes based on our Shotgun needs, but I worry about corrupting the database if I don't use the API. Anyone have any thoughts?


  • 0
    Ben Zenker


    From what I've used it for, it appears that the API is simply a way to create database rows, query the database columns, and update the values in any database column.

    Not sure if that answers your question

  • 0
    Satish Goda

    My guess is that the database is the low-level and its schema might be changed to improve speed. The API provides the filters to query the database (and seems fairly stable and would not change). So, using the API is better. Otherwise, you might have to update your OPM classes in case the schema changed.