Comments (7)
Why? Shouldn't this be done with the MySQL administration tools? It's not the task of Squeryl to manage database-specific defaults, I think.
But as you said on the mailing list: if a solution is found for setting engines per-table, it'd be the way to go.
from squeryl.
I think I see you point, but I thought that having MyISAM as the default adapter sucks, since it misleads those who think they are getting transactional behavior, don't you think ?
from squeryl.
Yes, it sucks, but it would be better in that case to disable the transaction functionality in Squeryl completely (e.g. by raising an exception if the engine doesn't support transactions, so that the dev is inclined to switch engine) when MyISAM is active, instead of ignoring the problem and going with a different engine. That's at least what I think.
Many (most?) MySQL installations use InnoDB per default, so this is only an issue for a few people.
from squeryl.
I can imagine some cases where people will use InnoDB for most of there application, (to get transactionality) but use MyISAM for a few tables, where they want maximum read performance. I've read about such uses cases where one has an application database on InnoDB, and a data warehouse on MyISAM.
from squeryl.
Perhaps a solution can be to simply have a constructor param in the MySQLAdapter that is the engine name, this has the advantage of forcing the user to make a concious choice, or at least to inform the user that such a choice exists.
from squeryl.
Actually, it uses MyISAM by default:
mysql> create table foo(id int);
Query OK, 0 rows affected (0.01 sec)
mysql> show create table foo;
+-------+-----------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------+
| foo | CREATE TABLE foo
(
id
int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-------+-----------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
It's a bit odd, but, that's how they get their fancy benchmarks.
I would certainly prefer if MySQL used InnoDB as a default, but it would be unexpected behaviour for that choice to be made in a client-side library.
I like the idea of throwing an exception if a user tries to start a transaction on a MyISAM table.
from squeryl.
closed since :
b701a9e
from squeryl.
Related Issues (20)
- postgres enum type in where clause doesn't work HOT 1
- PrimitiveTypeMode error HOT 1
- support java 8 time classes
- ResultSet not closed properly in operation "headOption"
- Not able to fetch the data from db
- Query generated without column names in select clause like "select from table"
- enable/fix Scala 2.13.0-RC1 test HOT 1
- squeryl.org domain name has expired HOT 1
- Clicking documentation on website gives 404 HOT 1
- java.lang.IncompatibleClassChangeError
- LinkageError on v0.9.14 HOT 1
- [Docs] All code snippets are broken
- Enum serialization and deserialization
- It's not possible to join more then 10 tables HOT 1
- Mapping error on left outer joins with queries as soon as null values are encountered
- schema.create for database that already exists?
- Crashes at initialisation on JDK 17 HOT 3
- scaladoc link got error
- Doc: Getting Started page render wrong result
- Update with composite key
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 squeryl.