title: ndb.gql vs ndb.query - Google App Engine
body: <p><a href="https://developers.google.com/appengine/docs/python/ndb/" rel="nofollow">https://developers.google.com/appengine/docs/python/ndb/</a></p>
  
  <p><a href="https://developers.google.com/appengine/docs/python/ndb/queries" rel="nofollow">https://developers.google.com/appengine/docs/python/ndb/queries</a></p>
  
  <p>Is there a difference between ndb.gql and ndb.query ? (beside the syntax)</p>
  
  <p>for example </p>
  
  <pre><code>cursor = ndb.gql("select * from Account")
  </code></pre>
  
  <p>vs </p>
  
  <pre><code>cursor = Account.query()
  </code></pre>
  
  <p>Because I like the ndb.query because I think it's more readable </p>
  
  <p>example:
  <code>acc=Account.query(Account.username==form.username.data,Account.password==form.password.data)</code></p>
  
  <p>I could not find any information if these two methods are different/equal under the hood.</p>
  
  <p>=> Maybe there is a perfomance tradeoff?</p>
  
  <blockquote>
    <p>If you are accustomed to SQL, beware of false assumptions when using
    GQL. GQL is translated to NDB's native query API. This is different
    from a typical Object-Relational mapper (like SQLAlchemy or Django's
    database support), where the API calls are translated into SQL before
    they are transmitted to the database server. GQL does not support
    Datastore modifications (inserts, deletes or updates); it only
    supports queries.</p>
  </blockquote>
  
  <p>I guess that ndb.query should be "faster" because it does not need to be translated right ?</p>