Git Product home page Git Product logo

Comments (9)

ceastwood avatar ceastwood commented on September 28, 2024 1

@fulviocanducci no sir, @ahmad-moussawi has been making regular commits and merges but the updates are on the myget feed. I have been tied up with work for a while but catching back up.

I'm sure we will work out a push to nuget soon

from querybuilder.

fulviocanducci avatar fulviocanducci commented on September 28, 2024 1

@ceastwood and @ahmad-moussawi

What would be the command to restart the class Query?

That?

public override Query NewQuery()
{
            return new Query().SetEngineScope(EngineScope);
}

from querybuilder.

ceastwood avatar ceastwood commented on September 28, 2024 1

@fulviocanducci

I will need to catch up on the execution package; I personally went a different way with query execution but will try to check this for you sometime in the near future.

from querybuilder.

ahmad-moussawi avatar ahmad-moussawi commented on September 28, 2024

First thanks for your suggestion :), you can use the Clone method for such cases

var baseQuery = new Query("People");

var q1 = baseQuery.Clone();
// some code here

var q2 = baseQuery.Clone();
// some code here

I don't see this would be really helpful since 1) the compiler should not change/modify the query in any way, 2) such implicit way would really confuse developers

for example, what if I want to compile the same query against multiple compilers ?

var query = new Query("People").Where("Id", 1);

mysql.Compile(query);

sqlsrv.Compiler(query);

pgsql.Compile(query);

from querybuilder.

fulviocanducci avatar fulviocanducci commented on September 28, 2024

Good as I had already reported, I am making a package by joining with your package (which is fantastic), it is already in the nuget as beta:

Github Source Code: https://github.com/fulviocanducci/Canducci.SqlKata.Dapper

I saw this need at the time of calling with Dapper, maybe solve this differently, if not every time we have to do it like this:

string cns = "Server=localhost;Database=testdb;Uid=root;Pwd=senha;SslMode=none";
MySqlConnection connection = new MySqlConnection(cns);

var log = connection.Build()
	.From("people")
	.Insert(new Dictionary<string, object>
	{
		["name"] = "Pedro c",
		["created"] = DateTime.Now.AddDays(-2)
	})
       .Execute();

var result = connection.Build()
	.NewQuery()
	.Select("*")
	.From("people")
	.Query();

The connection.Build() always creates a new instance, I wish it did not happen.

That is, this gives problem in the second execution

build
	.From("people")
	.Insert(new Dictionary<string, object>
	{
		["name"] = "Pedro c",
		["created"] = DateTime.Now.AddDays(-2)
	})
	.Execute(); // ok 

build
	.Select("*")
	.From("people")
	.Query(); // problem ...

I accept suggestions. !!!

from querybuilder.

fulviocanducci avatar fulviocanducci commented on September 28, 2024

Has the project stopped?

from querybuilder.

fulviocanducci avatar fulviocanducci commented on September 28, 2024

For some time this issue has been open, but has not yet been solved, and versions and versions have been released, I ask:

  • Do you think this should not be done?

  • Do you think that putting a method to leave the class at a default value for the generation of a new SQL would not be valid?

  • I would like to have an answer on the issue, so I can make decisions about a package I develop on top of that!

Thank you

from querybuilder.

fulviocanducci avatar fulviocanducci commented on September 28, 2024

I'm waiting for this is a pull request about recovering the inserted record!

from querybuilder.

ahmad-moussawi avatar ahmad-moussawi commented on September 28, 2024

@fulviocanducci, I've already suggested that you can use the Clone method for such cases.
Could you please elaborate more why this approach does not help in your case ?

from querybuilder.

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.