Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » SQL - option for real case of column/table/database names
SQL - option for real case of column/table/database names [message #57936] Wed, 29 December 2021 11:04 Go to next message
mezise is currently offline  mezise
Messages: 54
Registered: April 2006
Member
Hi,

I decided to write database management app in Upp but the requirement is to have real case names of columns, tables and databases.
Subject of not forced uppercase names in SQL was already mentioned in several posts but without any action for implementation.

Easy way to implement this is to add global option to SQL session.
Mirek, can you suggest the name for that option, where and how it should be assigned and accessed following your coding standards.

Thanks,
Michael

[Updated on: Wed, 29 December 2021 12:17]

Report message to a moderator

Re: SQL - option for real case of column/table/database names [message #57937 is a reply to message #57936] Wed, 29 December 2021 21:47 Go to previous messageGo to next message
mezise is currently offline  mezise
Messages: 54
Registered: April 2006
Member
Guys, could you apply those changes?
Example usage:
MySqlSession session;
session.UseRealcase();

Diff:
diff -r old_ver15947/uppsrc/Sql/Sql.cpp new/uppsrc/Sql/Sql.cpp
151,152c151,153
< 	for(int i = 0; i < cn->info.GetCount(); i++)
< 		cn->info[i].name = ToUpper(cn->info[i].name);
---
> 	if(!session.IsUseRealcase())
> 		for(int i = 0; i < cn->info.GetCount(); i++)
> 			cn->info[i].name = ToUpper(cn->info[i].name);
347c348,349
< 		s = ToUpper(s);
---
> 		if(!GetSession().IsUseRealcase())
> 			s = ToUpper(s);
364c366,367
< 		s = ToUpper(s);
---
> 		if(!GetSession().IsUseRealcase())
> 			s = ToUpper(s);
diff -r old_ver15947/uppsrc/Sql/Sqls.h new/uppsrc/Sql/Sqls.h
320a321
> 	bool                          use_realcase = false;
376a378,379
> 	bool                          IsUseRealcase() const                   { return use_realcase; }
> 	void                          UseRealcase()                           { use_realcase = true; }

[Updated on: Thu, 30 December 2021 14:41]

Report message to a moderator

Re: SQL - option for real case of column/table/database names [message #57938 is a reply to message #57937] Thu, 30 December 2021 02:08 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1077
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

Thank you for your patch! Mirek will definitely look at this! We encourage everyone to create Pull Requests on GitHub instead of posting diffs on this forum. It has several advantages over diff like integrated code review tool. Also PR is hard to miss instead of forum thread.

Do not feel pressure about PR - it will be just welcome.

Klugier


U++ - one framework to rule them all.

[Updated on: Thu, 30 December 2021 02:08]

Report message to a moderator

Re: SQL - option for real case of column/table/database names [message #57941 is a reply to message #57938] Thu, 30 December 2021 14:40 Go to previous message
mezise is currently offline  mezise
Messages: 54
Registered: April 2006
Member
Hi,

Thank you Klugier for suggestion of the most effective change implementation path. I have created pull request:
https://github.com/ultimatepp/ultimatepp/pull/58

mezise

[Updated on: Thu, 30 December 2021 14:41]

Report message to a moderator

Previous Topic: SQL_Sqlite3 GROUP_NAME error
Next Topic: Connection to the postgres db over ssh tunnel
Goto Forum:
  


Current Time: Thu Jun 13 19:03:45 CEST 2024

Total time taken to generate the page: 0.01384 seconds