Git Product home page Git Product logo

workers-qb's People

Contributors

dependabot[bot] avatar g4brym avatar programbo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

workers-qb's Issues

Thanks and quick question about TIMESTAMP

Thanks for the amazing library. Much easier to use than any of the popular ORMs. Anyway, sorry for the noob question, but I see that when updating or inserting, you can use something like this: created_at: new Raw("CURRENT_TIMESTAMP")

What is the underlying schema for a created_at or updated_at to use CURRENT_TIMESTAP? I was previously using something like this in D1: created_at INTEGER DEFAULT (cast(strftime('%s', 'now') as INTEGER)),

With the Raw, though, I'm not clear how it should be stored, as I don't see Timestamp as a data type in SQLite. Or is the CURRENT_TIMESTAMP only for postgres?

Thanks.

type definitions missing from v1.0.0

I'm not familiar with releasing node packages, but it looks like the type definitions are missing from the v1.0.0 release. The v0.1.12 release had the type declaration files in the top level of the dist directory. In the v1.0.0 release, it looks like there is a src directory that was absent in the v0.1.12 release, and the type declaration files are there instead of in the top level of the dist directory.

LIKE function not working

await qb.fetchAll({
tableName: 'users',
fields: ['name', 'email'],
where: {
conditions: ["name LIKE '%?1%'"],
params: ['John'],
},
orderBy: {
name: 'DESC',
},
});

Syntax error on UPDATE

I have a basic "update multiple fields" query that throws a syntax error. It's generating this query:

UPDATE pages SET (content = ?2) WHERE id = ?1

–which doesn't appear to be a valid statement. I'm not super familiar with SQL anymore, but it seems like removing the parentheses would correct the syntax.

Additionally, looking through the code, I noticed this query:

UPDATE pages SET (content = ?2, category = ?3) WHERE id = ?1

–was being called with these parameters being binded:

[ 'banana1', 'news', 'test' ]

In this case, the id is test, the content is banana1 and the category is news. It seems like ?1 and ?2 are being swapped. Is this intentional?

How can I mark an insert as only returning one row?

I'm inserting a row into a table, but the results property that comes back is typed as <TableType | TableType[]>.

My IDE gives the following error:

image

I'm guessing just casting the result to the singular is a workaround?

0.1.8

Hi, 0.1.8 is asking me to turn on node_compat when deploying a worker with wrangler even though i only use the D1 bindings.

JOIN support

Is there anyway to perform JOIN query? If there is, how can I do it?

db.batch feature

Try to implement db.batch for all workers-qb operation.

await db.batch([
db.prepare("UPDATE users SET name = ?1 WHERE id = ?2").bind( "John", 17 ),
db.prepare("UPDATE users SET age = ?1 WHERE id = ?2").bind( 35, 19 ),
]);

Run prettier on project and commit

Putting together a PR but getting a lot of syntax noise. Can you check your prettier settings then run npx prettier --write . and once you're happy with the result, commit it to master and I'll PR off that?

Order By's DESC/ASC not working

FYI, I have not been able to get the DESC/ASC command to work in plan Cloudflare. I added this library and noticed the issue. The result set is the same order for both DESC and ASC.

I tried it with OrderTypes and the 'ASC' string. I believe there may be a bug in the Cloudflare side though?

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.