Comments (5)
Not all drivers support different float numeric representation like SQLite.
But yes, it's probably a good idea.
from dbiish.
My take on floats was to use the Perl 6 type which is the default when you write my $float = 4.85;
which is Rat.
This has also the advantage of not having the usual float rounding errors.
Are there any downsides from your point of view which I've missed? Performance?
from dbiish.
@abraxxa if you write 'float' when you are thinking Rat is your business :-)
The real problem is that DBIish should support and handle well the data in a Data Base not necessarily designed to be Perl 6 specific.
If a DBA uses, for wherever reason IEEE-754 types, the program needs to handle them in a predictably way, for example if a field in my DB contains the DOUBLE 1e+287 I want to see 1e+287
and that operations with it run at native speed.
As DB systems are richer in types, the best option is to design DBIsh with plugable types conversions, not fixed ones.
from dbiish.
From c57a200 all drivers after prepare
expose in $sth.column-types[$col]
, the known field types to be returned.
In the SQLite case, where the column type is dynamic (and NUMERIC don't exist), the user can set the desired type before row fetching.
See https://github.com/perl6/DBIish/blob/master/lib/DBIish/CommonTesting.pm6#L216 for an example.
This mechanism will be generalized and extended for other drivers.
So I'm closing this issue.
from dbiish.
Salvador you rock! Thanks for pushing DBIish forward!
from dbiish.
Related Issues (20)
- $sth.allrows(:array-of-hash) not an exact replacement for $sth.fetchall_hashref('KEY') HOT 1
- Oracle Support - Forcing SELECT'ed field names to lower-case is bad mojo HOT 5
- Cannot avoid DBDish::Oracle: Error: ORA-01000: maximum open cursors exceeded HOT 6
- Failure to self manage statement handles causes DBDish::Oracle: Error: ORA-01000: maximum open cursors exceeded HOT 4
- CI Test Oracle for Oracle driver
- Support default value in insert&update HOT 1
- Places for placeholders HOT 1
- SQLite Threads: Getting errors on macos during install HOT 6
- Add support to firebird database HOT 4
- Native call expected argument 1 to reference a native integer, but got CPointer HOT 6
- DBDish::mysql error - Unsupported Concurrency: Connection used by multiple threads simultaneously HOT 7
- Oracle InstantClient 18 not used? HOT 10
- DBIish: DBDish::Pg needs 'pq', not found HOT 12
- BLOB support for Oracle?
- Cryptic error message on using disconnect HOT 2
- MySQL driver cannot handle bigint unsigned in `execute( )` HOT 14
- zef install test failures HOT 5
- Non-repeatable test failures in Github cron job HOT 2
- X::AdHoc: Cannot look up attributes in a VMNull type object. Did you forget a '.new'? HOT 10
- Some MySQL administrative queries return empty results HOT 2
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 dbiish.