GithubHelp home page GithubHelp logo

Allow new tables to be created for Ql about db HOT 4 CLOSED

upper avatar upper commented on August 25, 2024
Allow new tables to be created for Ql

from db.

Comments (4)

tmaiaroto avatar tmaiaroto commented on August 25, 2024

...and I've tried

drv := sess.Driver().(*sql.DB)
    rows, err := drv.Query("DROP TABLE IF EXISTS birthdays; CREATE TABLE birthdays (name string, born time)")

...But it can't seem to find sql or ql if I change it to that.

I think this would work for me, but I just need a little more documentation. Thanks.

from db.

tmaiaroto avatar tmaiaroto commented on August 25, 2024

Adding "database/sql" to my import seemed to help...but then

attempt to update the DB outside of a transaction

So I go to use Tx instead:

drv := tx.Driver().(*sql.DB)

and

This action is currently unsupported on this database.

from db.

xiam avatar xiam commented on August 25, 2024

I'm currently working on fixing transactions with QL.

Related: #25

from db.

xiam avatar xiam commented on August 25, 2024

Transactions are working in QL again, see: #25

Creating tables using the upper API is not supported and currently not planned, defining the data schema is a developer's responsibility and we should not make any assumptions on such decision.

If for some reason you need to create tables, you should use raw SQL. See the following example:

db/main_test.go

Line 314 in 9ef4a85

_, err = tx.Exec(`CREATE TABLE birthdays (

Also, each adapter has an example on how to use raw SQL: https://upper.io/db/postgresql

from db.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.