58 karma · joined May 11, 2016
Anyways I appreciate the name drop of Adonis. I'll have to give it a fair shake when I'm not feeling quite as cynical because I _really_ do want to find a solid Node framework in this area.
There's enough confusion here I suppose I'll start using the term "batteries included framework" for the technologies you listed.
The short of it though is there exists a perfect range of cards the bot can play where it neither folds enough for you to bluff to gain an edge, nor does it call enough that you can wait for better cards while bleeding chips to gain an edge.
https://en.wikipedia.org/wiki/Nash_equilibrium
However, if the opponent is playing sub-optimally you can win _more_ by deviating from Nash equilibrium to take advantage of their specific strategic shortcomings. The risk in doing so is if you are wrong estimating their shortcomings.. you are no longer guaranteed a tie in the worst case scenario.
You can see this play out with a small toy game and a card calculator. Suppose a two player game of Texas Holdem where each player has 8x big blinds. The first player must choose to either go all in or fold. The second player must choose to either call the all in or fold. Players must pick a range of hands to perform either action prior to looking at their cards.
https://openpokertools.com/range_equity.html
Suppose a silly strategy by the second player of folding any hand except pocket aces. You'd be wise as the first player to go all in with any hand and pick up a free big blind with 99.5% certainty. However going all in with every hand is also an easy strategy to take advantage of...
(You can actually go back and forth maximally exploiting the other player's strategy and you will eventually reach Nash equilibrium)
e.g. I'll lose 100% of my matches against a Chess GM but against the best poker player in the world I could go all in preflop every hand and still win the match ~20% of the time.
Only way to counter this variance is to play lots and lots of hands (Law of large numbers) It could take weeks/months in a single matchup to determine the better poker player.
In terms of playing for real money, in general you'll find more challenging competition at higher stakes. But then there's an incentive for bots.
You can also test migrations against a restored prod database snapshot but again there's no guarantee some incompatible data hasn't been inserted in the meantime.
Most of these are pretty important to us. I did try to put lower priority items near the bottom of the list. However, I did omit several nice-to-haves already. e.g. ActiveRecord's ability to diff changes after an update (ActiveModel::Dirty)
I wouldn't say any of them are complete full blockers by themselves but cumulatively yes they prevent us from considering Prisma for most projects.
- No supported way to do a case-insensitive sorting. https://github.com/prisma/prisma/issues/5068
- Can’t sort by an aggregate value like user’s post count. https://github.com/prisma/prisma/issues/3821
- Can’t control between inner/left join.
- Can’t do subqueries.
- Migration rollbacks are experimental maybe unsupported now? At least I only see mention in Github issues and not in the docs.
- Transactions appear to expect a series of queries? It doesn’t look like you can execute any app code during a transaction?
- No support for pessimistic row locking e.g. SELECT… FOR UPDATE ?
- No way to mixin raw query partials like `where('name ILIKE ?')`. You either need to write the whole query raw or not.
- Validations are done at the database level.
- Complex validations seem tricky to write in this format
- No built-in way to make clean user-facing validation messages.
- You can’t check that a model instance is valid without just trying to insert it into the database
- The official documented validation example has you connecting via psql and adding a constraint?
- So following the offical example my validations aren’t documented in the codebase via a model or a migration?
- Also they don’t have a validation example documented if you’re using MySQL instead of Postgres?
- Cascading deletes are handled the same way as validations. As in Prisma basically does nothing other than document how to implement it yourself outside of the library.
- No model methods. I guess that's not a surprised because it's "not an ORM". A model really is just a data mapping? Anyways it seems like you would end up rolling your own wrapper around this and there's no recommendations on standardized architecture.
- No callbacks. These have been controversial at times so are teams using Prisma writing something akin to "services" instead?
- Syntax nitpick but one of these is vulnerable to a SQL injection and it seems really easy for a new developer to get mixed up?
- prisma.$queryRaw(`SELECT \* FROM User WHERE email = ${email}`);
- prisma.$queryRaw`SELECT \* FROM User WHERE email = ${email}`;
- No way of batch loading like Active Records’s find_in_batches / find_each. All objects are just loaded into memory?
- No way of hooking into queries for instrumentation. e.g. ActiveSupport::Notifications.subscribe
FYI - This is after fairly brief research. Not guaranteed 100% accurate.