Comments (14)
I propose {protocol}://{hostname}[:{port}]/{database}
where []
indicates optional. The library probably should only work with the mapi:monetdb://
prefix, shall we make that optional also?
from pymonetdb.
I agree with the general proposal. I also am OK with having port and protocol specification optional.
URIs also allow for username/password specification: {protocol}://[username:password@]{hostname}[:port]/{database}
, although especially for the password entry I am not sure this is a very good idea: Apparently the username:password
format in the userinfo subcomponent has been deprecated: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Generic_syntax
from pymonetdb.
is the :
in mapi:monetdb
valid as schema?
i'm trying out the uritools
library which is supposed to be RFC 3986
compatible, but it has issues with this syntax:
In [1]: from uritools import uricompose, urijoin, urisplit, uriunsplit
In [2]: q = 'mapi:monetdb://user:[email protected]:50000/sf1'
In [3]: urisplit(q)
Out[3]: SplitResultUnicode(scheme='mapi', authority=None, path='monetdb://user:[email protected]:50000/sf1', query=None, fragment=None)
In [4]: q = 'monetdb://user:[email protected]:50000/sf1'
In [5]: urisplit(q)
Out[5]: SplitResultUnicode(scheme='monetdb', authority='user:[email protected]:50000', path='/sf1', query=None, fragment=None)
from pymonetdb.
I am quoting from RFC 3986:
3.1. Scheme
Each URI begins with a scheme name that refers to a specification for
assigning identifiers within that scheme. As such, the URI syntax is
a federated and extensible naming system wherein each scheme's
specification may further restrict the syntax and semantics of
identifiers using that scheme.Scheme names consist of a sequence of characters beginning with a
letter and followed by any combination of letters, digits, plus
("+"), period ("."), or hyphen ("-"). Although schemes are case-
insensitive, the canonical form is lowercase and documents that
specify schemes must do so with lowercase letters. An implementation
should accept uppercase letters as equivalent to lowercase in scheme
names (e.g., allow "HTTP" as well as "http") for the sake of
robustness but should only produce lowercase scheme names for
consistency.
So indeed the :
character is not allowed in the protocol part. We could substitute it with a '.' maybe, although I am not sure what other protocol besides mapi
would be meaningful here. Maybe versioned like mapi9
or mapi10
, but I don't see the value in having monetdb
there as well.
from pymonetdb.
looks to me like the core monetdb developers need to make a decision here.
from pymonetdb.
wouldn't it be better to have monetdb
as the protocol name, since a regular user will not be aware of the fact he or she is using MAPI? Also, isn't the protocol initialisation step smart enough to distinguish between version 9 and 10?
from pymonetdb.
@mlkersten @kutsurak I don't have any strong opinions about this, apart from that the monetdb://
seems to be the most intuitive syntax. What do you guys prefer?
from pymonetdb.
Honestly I would prefer the monetdb://
(or mapi9://
, or mapi10://
, or mapi://
) scheme. I remember though last time we discussed this that @njnes had some arguments against it related to ODBC.
from pymonetdb.
To stay within the odbc/jdbc uri scheme we should keep the mapi:monetdb:// etc here
jdbc:monetdb://[:]/[?=[&=]]
from pymonetdb.
so the odbc/jdbc URI scheme violates RFC 3986?
from pymonetdb.
I'm not sure thats how we should interpret the scheme: in this RFC. But as just discussed with Panos, we prefer (for pymonetdb) the sorter simple uri monetdb:// for example. So lets continue that way. That jdbc/odbc requires this is, shouldn't be a problem for the pymonetdb code. Seems we all agree now.
from pymonetdb.
Keep in mind that the "mapi" scheme has two different types:
mapi:monetdb://localhost:50001/test?lang=sql&user=monetdb
mapi:merovingian://proxy?database=test
With this in mind, the URI parses as
scheme: mapi
hier-part: monetdb://localhost:50001/test or merovingian://proxy
query: lang=sql&user=monetdb or database=test
The hier-part cannot be further broken down according to the generic syntax, so the authority that is defined there does not apply.
Perhaps it would be nice if it did, but then we cannot use the parts "monetdb:" and "merovingian:".
If we are to simplify the scheme so that we can use the generic syntax for the authority (i.e. username, hostname, port) we need to first remind ourselves how the monetdb and merovingian subschemes are used, and then how we can change those.
from pymonetdb.
ok, then I'm still not really sure what the consensus here is. Since I want to push out 1.3.0 out today, I'm moving this discussion to 2.0.0 since this is the last blocking issue.
from pymonetdb.
I was unaware of the discussion in this ticket but last year I submitted a pull request adding support for mapi:
urls and Gijs merged it, see #89.
The PR implemented a libmapi-like mapi:monetdb://... syntax so you can copy/paste from monetdb status
.
from pymonetdb.
Related Issues (20)
- Make code style checking stricter (mypy and flake8)
- Value error in dates HOT 1
- Problem with parameters in execute. HOT 5
- Control.status() crashes when connecting without a host name
- Add support for prepared statements HOT 4
- Properly handle multiple result sets HOT 2
- Make Cursor.execute() return None instead of -1 HOT 1
- pymonetdb can not upload to remote MonetDB server from client HOT 2
- Separate SQL errors from connection errors during query execution HOT 5
- SQLSTATE error code removed from error messages HOT 6
- Fix master branch, travis is failing HOT 1
- Re-enable travis integration HOT 1
- Support day interval type HOT 4
- `cursor.executemany` does not work as expected HOT 2
- Use of BokenPipeError breaks DBAPI compatability in 1.4.0 HOT 2
- Rename pymonetdb (back) to (python-)monetdb HOT 1
- Day interval issue? HOT 1
- Connection object leaks the password HOT 1
- slow data transfer HOT 2
- Github actions broken HOT 3
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 pymonetdb.