Comments (4)
I think this diff will implement required feature:
diff --git a/lib/adapters/postgres.js b/lib/adapters/postgres.js
index e3f848c..aff215c 100644
--- a/lib/adapters/postgres.js
+++ b/lib/adapters/postgres.js
@@ -196,7 +196,7 @@ PG.prototype.fromDatabase = function (model, data) {
};
PG.prototype.escapeName = function (name) {
- return '"' + name + '"';
+ return '"' + name.replace(/\./g, '"."') + '"';
};
When defining model, just pass 'tableName' param, or use setTableName('database.table') in railwayjs
from jugglingdb.
The only problem I see is if a table really had a . In its name. I don't,
but maye someone will have one at some point. I'm not sure if that casee
warrants looking for a more elaborate solution
On 12 Apr 2012 20:26, "Anatoliy Chakkaev" <
[email protected]>
wrote:
I think this diff will implement required feature:
diff --git a/lib/adapters/postgres.js b/lib/adapters/postgres.js
index e3f848c..aff215c 100644
--- a/lib/adapters/postgres.js
+++ b/lib/adapters/postgres.js
@@ -196,7 +196,7 @@ PG.prototype.fromDatabase = function (model, data) {
};
PG.prototype.escapeName = function (name) {
- return '"' + name + '"';
+ return '"' + name.replace(/\./g, '"."') + '"';
};
When defining model, just pass 'tableName' param, or use
setTableName('database.table') in railwayjs
Reply to this email directly or view it on GitHub:
#68 (comment)
from jugglingdb.
Yep, this may cause issues, but we don't break existing code, since
setTableName is not documented feature yet.
And one more thing need to review - migration on postgres after this change.
On Fri, Apr 13, 2012 at 4:39 AM, fsateler <
[email protected]
wrote:
The only problem I see is if a table really had a . In its name. I don't,
but maye someone will have one at some point. I'm not sure if that casee
warrants looking for a more elaborate solutionOn 12 Apr 2012 20:26, "Anatoliy Chakkaev" <
[email protected]>
wrote:I think this diff will implement required feature:
diff --git a/lib/adapters/postgres.js b/lib/adapters/postgres.js index e3f848c..aff215c 100644 --- a/lib/adapters/postgres.js +++ b/lib/adapters/postgres.js @@ -196,7 +196,7 @@ PG.prototype.fromDatabase = function (model, data) { }; PG.prototype.escapeName = function (name) { - return '"' + name + '"'; + return '"' + name.replace(/\./g, '"."') + '"'; };When defining model, just pass 'tableName' param, or use
setTableName('database.table') in railwayjs
Reply to this email directly or view it on GitHub:
#68 (comment)
Reply to this email directly or view it on GitHub:
#68 (comment)
Thanks,
Anatoliy Chakkaev
from jugglingdb.
Everything is working fine.
from jugglingdb.
Related Issues (20)
- README documentation references are not reachable
- is this project dead ? HOT 5
- Potentially unhandled rejection [2] TypeError, when upgrading to new version of node. HOT 1
- Site down HOT 2
- Support multiple hooks per action
- Validations should be revisited
- Deprecate mutation features
- Consider removing all instance methods
- Disallow mixins on Model
- Model relations
- how to query field in multiple values? HOT 1
- Can i use JugglingDB in production? HOT 4
- process rpc message error TypeError: User.bulkUpdate is not a function HOT 2
- How can i delete one record ?
- Is this project maintained? HOT 2
- How to get the table definition from a datasource?
- upsert method doesn't trigger any hooks for mysql adapter HOT 3
- In
- Use in production? HOT 2
- Composite primary keys / composite foreign keys
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 jugglingdb.