Comments (5)
that is not valid oracle SQL atleats.. to escape quotes in oralc ethey get doubled..
ie INSERT INTO ..... VALUES('TEST', 'T''s Use Rate(%) (%)' , 'TT''s Use Rate(%) (%)' , 'OTHER')
i dont knwo about other SQL varients
from fsqlf.
Example: Table 9.1
http://dev.mysql.com/doc/refman/5.0/en/string-literals.html
from fsqlf.
Hi zhgzhg,
Thanks for reporting the issue.
But...
In short:
Sorry, I can not promise you a quick resolution of this issue.
(honest proposal: if this is real problem, please use something else.
Search for "free sql formatter" gives some quite good online tools)
Longer version:
mysql
syntax is incompatible with other sql syntaxes.
(i.e. if mysql
case is naively fixed, then other flavors of sql syntax get broken)
Effective fix would include some mode switching to handle only single syntax at one time
("option: use mysql
syntax", "option: use postgre
syntax", "option: use oracle syntax")
But this is problematic because,
it requires quite significant changes to "architecture" of fsqlf
(flex regex for string is hardcoded).
That said. I will definitely try to fix this. (but first I have to come up with good plan how to go about it. Proposals are welcome)
from fsqlf.
Hi @dnsmkl,
For open source databases, perhaps the best solution is to use their own parser. See this interesting post
Not suggesting that fsqlf
go down this path. I don't think it is worth the effort. When I have run into similar issues with SQL Server syntax oddities I modify the query so fsqlf
can format it and then undo the modifications.
Unrelated news. I have command line fsqlf
building and running on OSX. There are some odd differences in the output compared to Ubuntu. Will submit a PR after I track those down.
from fsqlf.
Hi @rohitn,
thanks for the link and idea.
You are completely right, best solution would be to use parser of actual database.
(or at least parser that is recognized as very good for that db syntax)
..but I don't have that much energy&time that this would require.
from fsqlf.
Related Issues (10)
- Location of formatting.conf HOT 4
- After formatting INNER JOIN turn into JOIN HOT 3
- ~/.fsqlf/ support under Windows HOT 1
- add correction of formatting
- Doesn't handle + & etc. in text strings
- bits/libc-header-start.h: No such file or directory HOT 2
- [feature wish] `cli` make target
- bug
- Feature request: new keywords HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fsqlf.